From cb71bf4ba5c55b6220637daec251d934343a667f Mon Sep 17 00:00:00 2001 From: LCastr0 Date: Sun, 5 Jun 2016 17:44:34 -0300 Subject: [PATCH] Removes morphs from gadget persistence (PC-429) --- .../mineplex/core/common/util/UtilPlayer.java | 6 + .../mineplex/core/bonuses/BonusManager.java | 2 + .../cosmetic/ui/page/KitGameModifierPage.java | 5 +- .../mineplex/core/cosmetic/ui/page/Menu.java | 2 +- .../core/cosmetic/ui/page/PetPage.java | 7 +- .../disguises/DisguiseAnimalBase.java | 10 +- .../mineplex/core/gadget/GadgetManager.java | 143 ++++++++++-------- .../gamemodifiers/kits/KitGameModifier.java | 39 ++--- .../gamemodifiers/kits/KitModifier.java | 77 ++++++++-- .../GameModifierMineStrikeSkin.java | 2 +- .../gadget/gadgets/item/ItemFleshHook.java | 10 +- .../gadget/gadgets/item/ItemFreezeCannon.java | 6 +- .../gadgets/item/ItemMelonLauncher.java | 8 +- .../gadget/gadgets/item/ItemPartyPopper.java | 14 +- .../core/gadget/gadgets/morph/MorphBat.java | 10 +- .../gadget/gadgets/morph/MorphVillager.java | 8 +- .../persistence/UserGadgetPersistence.java | 48 +++--- .../core/gadget/types/GadgetGameModifier.java | 9 +- .../core/gadget/types/OutfitGadget.java | 20 ++- .../core/projectile/ProjectileManager.java | 9 +- .../core/projectile/ProjectileUser.java | 10 +- .../clans/clans/potato/PotatoManager.java | 4 +- .../mineplex/hub/modules/StackerManager.java | 6 +- .../classcombat/Skill/Brute/BlockToss.java | 19 ++- .../classcombat/Skill/Brute/FleshHook.java | 13 +- .../classcombat/Skill/Knight/AxeThrow.java | 14 +- .../classcombat/Skill/Mage/FreezingBlast.java | 12 +- .../classcombat/Skill/Mage/GlacialBlade.java | 19 +-- .../classcombat/Skill/Mage/IcePrison.java | 10 +- .../classcombat/Skill/Mage/LightningOrb.java | 8 +- .../game/classcombat/item/Consume/Apple.java | 12 +- .../item/Throwable/PoisonBall.java | 8 +- .../item/Throwable/ProximityExplosive.java | 19 ++- .../item/Throwable/ProximityZapper.java | 20 ++- .../item/Throwable/WaterBottle.java | 12 +- .../game/classcombat/item/Throwable/Web.java | 11 +- .../boss/slimeking/ability/RocketAbility.java | 8 +- .../boss/spider/attacks/SpiderPoison.java | 6 +- .../mobs/perks/PerkBlockTossEVO.java | 16 +- .../mobs/perks/PerkSulphurBombEVO.java | 10 +- .../evolution/mobs/perks/PerkWebEVO.java | 6 +- .../game/games/lobbers/BombLobbers.java | 14 +- .../game/arcade/game/games/runner/Runner.java | 6 +- .../games/smash/perks/PerkFishFlurry.java | 10 +- .../arcade/game/games/stacker/Stacker.java | 10 +- .../survivalgames/kit/KitBeastmaster.java | 2 +- .../games/survivalgames/kit/KitHorseman.java | 2 +- .../survivalgames/kit/KitNecromancer.java | 2 +- .../games/wizards/spells/SpellIcePrison.java | 8 +- .../games/wizards/spells/SpellIceShards.java | 8 +- .../games/wizards/spells/SpellWebShot.java | 13 +- .../game/arcade/kit/perks/PerkApple.java | 51 +++++-- .../game/arcade/kit/perks/PerkAxeThrower.java | 12 +- .../game/arcade/kit/perks/PerkBaconBlast.java | 10 +- .../arcade/kit/perks/PerkBlockRestorer.java | 6 +- .../game/arcade/kit/perks/PerkBlockToss.java | 16 +- .../game/arcade/kit/perks/PerkBoneRush.java | 14 +- .../game/arcade/kit/perks/PerkCowBomb.java | 12 +- .../kit/perks/PerkCreeperSulphurBomb.java | 11 +- .../arcade/kit/perks/PerkHammerThrow.java | 10 +- .../game/arcade/kit/perks/PerkHorsePet.java | 43 +++++- .../game/arcade/kit/perks/PerkInkBlast.java | 9 +- .../game/arcade/kit/perks/PerkIronHook.java | 12 +- .../arcade/kit/perks/PerkMadScientist.java | 36 ++--- .../arcade/kit/perks/PerkPigBaconBounce.java | 12 +- .../game/arcade/kit/perks/PerkRevealer.java | 12 +- .../game/arcade/kit/perks/PerkSkeletons.java | 42 ++++- .../arcade/kit/perks/PerkSlimeRocket.java | 8 +- .../game/arcade/kit/perks/PerkSquidRifle.java | 10 +- .../arcade/kit/perks/PerkSquidShotgun.java | 14 +- .../arcade/kit/perks/PerkSquidSniper.java | 14 +- .../game/arcade/kit/perks/PerkThrower.java | 12 +- .../game/arcade/kit/perks/PerkWeb.java | 4 +- .../game/arcade/kit/perks/PerkWebShot.java | 12 +- .../game/arcade/kit/perks/PerkWitherWeb.java | 6 +- .../game/arcade/kit/perks/PerkWolfPet.java | 132 ++++++++++------ .../game/arcade/kit/perks/PerkWoolBomb.java | 10 +- .../game/arcade/kit/perks/PerkZombieBile.java | 12 +- .../arcade/managers/chat/GameChatManager.java | 2 +- 79 files changed, 757 insertions(+), 540 deletions(-) diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilPlayer.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilPlayer.java index db3fb1cea..9f5f14739 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilPlayer.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilPlayer.java @@ -937,4 +937,10 @@ public class UtilPlayer return false; return true; } + + public static void removeAllowedCommands(Player player) + { + if (ALLOWED_COMMANDS.containsKey(player.getUniqueId())) + ALLOWED_COMMANDS.remove(player.getUniqueId()); + } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/bonuses/BonusManager.java b/Plugins/Mineplex.Core/src/mineplex/core/bonuses/BonusManager.java index e956e3afd..bb52b991d 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/bonuses/BonusManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/bonuses/BonusManager.java @@ -1067,6 +1067,8 @@ public class BonusManager extends MiniClientPlugin implements I public void Quit(PlayerQuitEvent event) { _showCarl.remove(event.getPlayer().getName()); + // Removes from allow command map + UtilPlayer.removeAllowedCommands(event.getPlayer()); } @EventHandler diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/KitGameModifierPage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/KitGameModifierPage.java index 73fc6c92d..6dfa6cf0a 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/KitGameModifierPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/KitGameModifierPage.java @@ -2,6 +2,7 @@ package mineplex.core.cosmetic.ui.page; import mineplex.core.account.CoreClientManager; import mineplex.core.common.util.C; +import mineplex.core.common.util.UtilServer; import mineplex.core.cosmetic.CosmeticManager; import mineplex.core.cosmetic.ui.CosmeticShop; import mineplex.core.donation.DonationManager; @@ -53,11 +54,7 @@ public class KitGameModifierPage extends GadgetPage if(slot%9 == 8) slot += 2; } - else - continue; } - else - continue; } addButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), new IButton() 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 0e9be9ddf..10835827f 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 @@ -198,7 +198,7 @@ public class Menu extends ShopPageBase }); type = GadgetType.WinEffect; - lore = getLore(ownedCount.get(type), maxCount.get(type), "Winning a game with your friends all good and dandy, but then being able to also show off awsome effects is even more fun!", "Usable in Lobbies", enabled.get(type)); + lore = getLore(ownedCount.get(type), maxCount.get(type), "Winning a game with your friends all good and dandy, but then being able to also show off awesome effects is even more fun!", "Usable in Lobbies", enabled.get(type)); addButton(winEffectSlot, new ShopItem(Material.CAKE, "Win Effects", lore, 1, false), new OpenWinEffect(this, enabled.get(type))); if (enabled.containsKey(type)) addGlow(winEffectSlot); 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 785dbb527..7e97f02fc 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 @@ -187,7 +187,12 @@ public class PetPage extends ShopPageBase itemLore.add(C.cWhite + "You must have an active pet to use this!"); getInventory().setItem(slot, new ShopItem(petExtra.GetMaterial(), (byte)0, C.cRed + petExtra.getName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false).getHandle()); } - else if (getPlugin().getPetManager().getActivePet(getPlayer().getName()).getType() != EntityType.WITHER) + // Silverfish = Wither disguised + // Villager = Elf + // Zombie = Pumpkin + else if (getPlugin().getPetManager().getActivePet(getPlayer().getName()).getType() != EntityType.SILVERFISH + || getPlugin().getPetManager().getActivePet(getPlayer().getName()).getType() != EntityType.VILLAGER + || getPlugin().getPetManager().getActivePet(getPlayer().getName()).getType() != EntityType.ZOMBIE) { addButton(slot, new ShopItem(petExtra.GetMaterial(), (byte) 0, "Rename " + getPlugin().getPetManager().getActivePet(getPlayer().getName()).getCustomName() + " for " + C.cYellow + petExtra.getCost(CurrencyType.Coins) + C.cGreen + " Shards", itemLore.toArray(new String[itemLore.size()]), 1, false, false), new RenamePetButton(this)); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseAnimalBase.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseAnimalBase.java index c41d03dd4..f47327a24 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseAnimalBase.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseAnimalBase.java @@ -1,5 +1,13 @@ package mineplex.core.disguise.disguises; -public class DisguiseAnimalBase +import org.bukkit.entity.EntityType; + +public class DisguiseAnimalBase extends DisguiseAnimal { + + public DisguiseAnimalBase(EntityType entityType, org.bukkit.entity.Entity entity) + { + super(entityType, entity); + } + } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java index 5d2c9fbe4..6bb1e5c66 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java @@ -4,11 +4,12 @@ import java.util.*; import java.util.function.Predicate; import mineplex.core.gadget.commands.LockCosmeticsCommand; -import mineplex.core.gadget.event.GadgetAppliedEvent; import mineplex.core.gadget.event.GadgetEnableEvent; -import mineplex.core.gadget.gadgets.outfit.windupsuit.OutfitWindUpSuitBoosterManager; +import mineplex.core.gadget.gadgets.gamemodifiers.kits.KitModifier; +import mineplex.core.gadget.gadgets.outfit.windupsuit.*; import mineplex.core.gadget.gadgets.particle.candycane.ParticleCandyCane; import mineplex.core.gadget.persistence.UserGadgetPersistence; +import mineplex.core.gadget.set.suits.SetWindUpSuit; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; @@ -260,8 +261,7 @@ public class GadgetManager extends MiniPlugin //Costumes addSet(new SetRaveSuit(this)); addSet(new SetSpaceSuit(this)); - //Removes WindUp suit for now, as it's not going to be released - //addSet(new SetWindUpSuit(this)); + addSet(new SetWindUpSuit(this)); addSet(new SetParty(this)); addSet(new SetCupidsLove(this)); addSet(new SetEmerald(this)); @@ -306,10 +306,10 @@ public class GadgetManager extends MiniPlugin addGadget(new OutfitSpaceSuitLeggings(this)); addGadget(new OutfitSpaceSuitBoots(this)); - //addGadget(new OutfitWindUpSuitHelmet(this)); - //addGadget(new OutfitWindUpSuitChestplate(this)); - //addGadget(new OutfitWindUpSuitLeggings(this)); - //addGadget(new OutfitWindUpSuitBoots(this)); + addGadget(new OutfitWindUpSuitHelmet(this)); + addGadget(new OutfitWindUpSuitChestplate(this)); + addGadget(new OutfitWindUpSuitLeggings(this)); + addGadget(new OutfitWindUpSuitBoots(this)); addGadget(new OutfitTeam(this, "Team Helmet", -1, ArmorSlot.Helmet, Material.LEATHER_HELMET, (byte)0)); addGadget(new OutfitTeam(this, "Team Shirt", -1, ArmorSlot.Chest, Material.LEATHER_CHESTPLATE, (byte)0)); @@ -461,29 +461,16 @@ public class GadgetManager extends MiniPlugin // Survival Games - // Also not being released in this update - // Beastmaster - //addGadget(new ChickenKitGameModifier(this)); - //addGadget(new MiniGuardianKitGameModifier(this)); - //addGadget(new PigKitGameModifier(this)); - //addGadget(new SquidKitGameModifier(this)); - - // Horseman - //addGadget(new MuleKitGameModifier(this)); - //addGadget(new SkeletonHorseKitGameModifier(this)); - - // Necromancer - //addGadget(new WitherSkeletonKitGameModifier(this)); - - - // Bridges - //addGadget(new PotatoKitGameModifier(this)); + for (KitModifier kitModifier : KitModifier.values()) + { + addGadget(new KitGameModifier(this, kitModifier)); + } for(GadgetType type : GadgetType.values()) { if(!_gadgets.containsKey(type)) { - _gadgets.put(type, new ArrayList()); + _gadgets.put(type, new ArrayList<>()); } } } @@ -829,21 +816,15 @@ public class GadgetManager extends MiniPlugin } @EventHandler - public void quit(PlayerQuitEvent event) + public void onPlayerQuit(PlayerQuitEvent event) { + saveGadgets(event.getPlayer()); disableAll(event.getPlayer(), false); _lastMove.remove(event.getPlayer()); _playerActiveGadgetMap.remove(event.getPlayer()); event.getPlayer().setWalkSpeed(0.2f); event.getPlayer().setFlySpeed(0.1f); } - - @EventHandler - public void join(PlayerJoinEvent event) - { - event.getPlayer().setWalkSpeed(0.2f); - event.getPlayer().setFlySpeed(0.1f); - } @EventHandler public void death(PlayerDeathEvent event) @@ -975,43 +956,79 @@ public class GadgetManager extends MiniPlugin event.setCancelled(true); } - @EventHandler - public void onGadgetApplied(GadgetAppliedEvent event) + private void saveGadgets(Player player) { - Player player = event.getPlayer(); - Gadget gadget = event.getGadget(); - GadgetType gadgetType = gadget.getGadgetType(); - switch (gadgetType) + Map cache = new HashMap<>(); + for (Gadget gadget : getAllGadgets()) { - case MusicDisc: - case Item: - break; - case Costume: - OutfitGadget outfitGadget = (OutfitGadget) gadget; - switch (outfitGadget.getSlot()) + if (gadget.ownsGadget(player)) + { + GadgetType gadgetType = gadget.getGadgetType(); + switch (gadgetType) { - case Helmet: - _userGadgetPersistence.save(player, "activeCostumeHelmet", outfitGadget.getName()); + case MusicDisc: + case Item: + case Morph: break; - case Chest: - _userGadgetPersistence.save(player, "activeCostumeChestplate", outfitGadget.getName()); + 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 Legs: - _userGadgetPersistence.save(player, "activeCostumeLeggings", outfitGadget.getName()); + case GameModifier: + GadgetGameModifier gadgetGameModifier = (GadgetGameModifier) gadget; + if (gadgetGameModifier.canAllowMultiple()) + { + if (cache.containsKey(gadget.getName())) + continue; + cache.put(gadget.getName(), (gadget.isActive(player)) ? "enabled" : "disabled"); + } + else + { + String dataKey = "activeModifier" + gadgetGameModifier.getGameType().getName().replace(" ", ""); + if (cache.containsKey(dataKey)) + continue; + if (gadget.isActive(player)) + cache.put(dataKey, gadget.getName()); + } break; - case Boots: - _userGadgetPersistence.save(player, "activeCostumeBoots", outfitGadget.getName()); + default: + if (cache.containsKey(gadgetType.getDatabaseKey())) + continue; + if (gadget.isActive(player)) + cache.put(gadgetType.getDatabaseKey(), gadget.getName()); break; } - break; - case GameModifier: - GadgetGameModifier gadgetGameModifier = (GadgetGameModifier) gadget; - String key = "active" + gadget.getName().replace(" ", "") + gadgetGameModifier.getGameType().getName().replace(" ", ""); - _userGadgetPersistence.save(player, key, "enabled"); - break; - default: - _userGadgetPersistence.save(player, gadgetType.getDatabaseKey(), gadget.getName()); - break; + } } + _userGadgetPersistence.save(player, cache); + } + + public boolean isKitModifierActive(KitModifier kitModifier, Player player) + { + for (Gadget gadget : getGadgets(GadgetType.GameModifier)) + { + if (gadget instanceof KitGameModifier) + { + KitGameModifier kitGameModifier = (KitGameModifier) gadget; + if (kitGameModifier.getKitModifier().equals(kitModifier)) + return kitGameModifier.isActive(player); + } + } + return false; + } + + public KitModifier getActiveKitModifier(KitModifierType kitModifierType, Player player) + { + for (KitModifier kitModifier : KitModifier.values()) + { + if (kitModifier.getKitModifierType().equals(kitModifierType)) + if (isKitModifierActive(kitModifier, player)) + return kitModifier; + } + return null; } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/gamemodifiers/kits/KitGameModifier.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/gamemodifiers/kits/KitGameModifier.java index 13948042c..666db3575 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/gamemodifiers/kits/KitGameModifier.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/gamemodifiers/kits/KitGameModifier.java @@ -17,17 +17,15 @@ import java.util.function.Predicate; public class KitGameModifier extends GadgetGameModifier { - private KitModifierType _kitType; - private String _kit; - private String _id; + private KitModifier _kitModifier; + private KitModifierType _kitType; - public KitGameModifier(GadgetManager manager, GameModifierType gameType, KitModifierType kitType, String name, String[] desc, - int cost, Material material, byte data, String kit, String id) + public KitGameModifier(GadgetManager manager, KitModifier kitModifier) { - super(manager, gameType, name, desc, cost, material, data); - _kitType = kitType; - _kit = kit; - _id = id; + super(manager, kitModifier.getKitModifierType().getGameModifierType(), kitModifier.getName(), kitModifier.getLore(), kitModifier.getCost(), + kitModifier.getMaterial(), kitModifier.getData(), false); + _kitModifier = kitModifier; + _kitType = kitModifier.getKitModifierType(); } public KitModifierType getKitType() @@ -35,36 +33,31 @@ public class KitGameModifier extends GadgetGameModifier return _kitType; } - public String getKit() - { - return _kit; - } - - public String getId() - { - return _id; - } + public KitModifier getKitModifier() + { + return _kitModifier; + } @Override public void enableCustom(Player player) { - Manager.getGameModifiers(getGameType()).stream().filter(getKitFilter(_kit)).forEach(g -> g.disable(player)); + Manager.getGameModifiers(getGameType()).stream().filter(getKitFilter(_kitType)).forEach(g -> g.disable(player)); super.enableCustom(player); } /** - * Filters kit based on name - * @param kitName + * Filters kit based on type + * @param kitModifierType * @return */ - public static Predicate getKitFilter(String kitName) + public static Predicate getKitFilter(KitModifierType kitModifierType) { return new Predicate() { @Override public boolean test(GadgetGameModifier g) { if (!(g instanceof KitGameModifier)) { return false; } - return ((KitGameModifier)g).getKit().equalsIgnoreCase(kitName); + return ((KitGameModifier)g).getKitType().equals(kitModifierType); } }; } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/gamemodifiers/kits/KitModifier.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/gamemodifiers/kits/KitModifier.java index 1c507c30d..750b36583 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/gamemodifiers/kits/KitModifier.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/gamemodifiers/kits/KitModifier.java @@ -1,22 +1,77 @@ package mineplex.core.gadget.gadgets.gamemodifiers.kits; +import mineplex.core.common.util.UtilEnt; +import org.bukkit.Material; +import org.bukkit.entity.EntityType; + public enum KitModifier { // Bridges - Bridges_Apple_Potato, + Bridges_Apple_Potato(KitModifierType.Bridges_AppleKit, "Potato", new String[] {"Placeholder"}, Material.POTATO_ITEM, 0), // Survival Games - Survival_Games_Beastmaster_Chicken, - Survival_Games_Beastmaster_Mini_Guardian, - Survival_Games_Beastmaster_Pig, - Survival_Games_Beastmaster_Squid, - Survival_Games_Horseman_Mule, - Survival_Games_Horseman_Skeleton_Horse, - Survival_Games_Horseman_Zombie_Horse, - Survival_Games_Necromancer_Wither_Skeleton, - Survival_Games_Necromancer_Zombie + Survival_Games_Beastmaster_Chicken(KitModifierType.SurvivalGames_BeastmasterKit, "Chicken", new String[] {"Placeholder"}, Material.MONSTER_EGG, UtilEnt.getEntityEggData(EntityType.CHICKEN), 0), + Survival_Games_Beastmaster_Mini_Guardian(KitModifierType.SurvivalGames_BeastmasterKit, "Mini Guardian", new String[] {"Placeholder"}, Material.MONSTER_EGG, UtilEnt.getEntityEggData(EntityType.GUARDIAN), 0), + Survival_Games_Beastmaster_Pig(KitModifierType.SurvivalGames_BeastmasterKit, "Pig", new String[] {"Placeholder"}, Material.MONSTER_EGG, UtilEnt.getEntityEggData(EntityType.PIG), 0), + Survival_Games_Beastmaster_Squid(KitModifierType.SurvivalGames_BeastmasterKit, "Squid", new String[] {"Placeholder"}, Material.MONSTER_EGG, UtilEnt.getEntityEggData(EntityType.SQUID), 0), + Survival_Games_Horseman_Mule(KitModifierType.SurvivalGames_HorsemanKit, "Mule", new String[] {"Placeholder"}, Material.CHEST, 0), + Survival_Games_Horseman_Skeleton_Horse(KitModifierType.SurvivalGames_HorsemanKit, "Skeleton Horse", new String[] {"Placeholder"}, Material.BONE, 0), + Survival_Games_Horseman_Zombie_Horse(KitModifierType.SurvivalGames_HorsemanKit, "Zombie Horse", new String[] {"Placeholder"}, Material.ROTTEN_FLESH, 0), + Survival_Games_Horseman_Donkey(KitModifierType.SurvivalGames_HorsemanKit, "Donkey", new String[] {"Placeholder"}, Material.CHEST, 0), + Survival_Games_Necromancer_Wither_Skeleton(KitModifierType.SurvivalGames_NecromancerKit, "Wither Skeleton", new String[] {"Placeholder"}, Material.SKULL_ITEM, (byte) 1, 0), + Survival_Games_Necromancer_Zombie(KitModifierType.SurvivalGames_NecromancerKit, "Zombie", new String[] {"Placeholder"}, Material.SKULL_ITEM, (byte) 2, 0); - KitModifier + private final KitModifierType _kitModifierType; + private final String _name; + private final String[] _lore; + private final Material _material; + private final byte _data; + private final int _cost; + + KitModifier(KitModifierType kitModifierType, String name, String[] lore, Material material, int cost) + { + this(kitModifierType, name, lore, material, (byte) 0, cost); + } + + KitModifier(KitModifierType kitModifierType, String name, String[] lore, Material material, byte data, int cost) + { + _kitModifierType = kitModifierType; + _name = name; + _lore = lore; + _material = material; + _data = data; + _cost = cost; + } + + public KitModifierType getKitModifierType() + { + return _kitModifierType; + } + + public String getName() + { + return _name; + } + + public String[] getLore() + { + return _lore; + } + + public Material getMaterial() + { + return _material; + } + + public byte getData() + { + return _data; + } + + public int getCost() + { + return _cost; + } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/gamemodifiers/minestrike/GameModifierMineStrikeSkin.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/gamemodifiers/minestrike/GameModifierMineStrikeSkin.java index 74c989f4f..eb9efdfb9 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/gamemodifiers/minestrike/GameModifierMineStrikeSkin.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/gamemodifiers/minestrike/GameModifierMineStrikeSkin.java @@ -37,7 +37,7 @@ public class GameModifierMineStrikeSkin extends GadgetGameModifier int cost, Material displayMat, int displayData) { super(manager, GameModifierType.MineStrike, name, - UtilText.splitLinesToArray(lore, LineFormat.LORE), cost, displayMat, (byte) displayData); + UtilText.splitLinesToArray(lore, LineFormat.LORE), cost, displayMat, (byte) displayData, true); _weapon = weaponName; _skinMat = newSkin; _skinData = newSkinData; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFleshHook.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFleshHook.java index a22679254..4f53d1384 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFleshHook.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFleshHook.java @@ -56,12 +56,12 @@ public class ItemFleshHook extends ItemGadget implements IThrown @Override public void Collide(LivingEntity target, Block block, ProjectileUser data) { - data.GetThrown().remove(); + data.getThrown().remove(); - if (!(data.GetThrower() instanceof Player)) + if (!(data.getThrower() instanceof Player)) return; - Player player = (Player)data.GetThrower(); + Player player = (Player)data.getThrower(); if (target == null) return; @@ -85,12 +85,12 @@ public class ItemFleshHook extends ItemGadget implements IThrown @Override public void Idle(ProjectileUser data) { - data.GetThrown().remove(); + data.getThrown().remove(); } @Override public void Expire(ProjectileUser data) { - data.GetThrown().remove(); + data.getThrown().remove(); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFreezeCannon.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFreezeCannon.java index a993f9854..ce3e899d1 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFreezeCannon.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFreezeCannon.java @@ -100,7 +100,7 @@ public class ItemFreezeCannon extends ItemGadget implements IThrown target.playEffect(EntityEffect.HURT); } - smash(data.GetThrown()); + smash(data.getThrown()); } @EventHandler @@ -173,13 +173,13 @@ public class ItemFreezeCannon extends ItemGadget implements IThrown @Override public void Idle(ProjectileUser data) { - smash(data.GetThrown()); + smash(data.getThrown()); } @Override public void Expire(ProjectileUser data) { - smash(data.GetThrown()); + smash(data.getThrown()); } public void smash(Entity ent) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemMelonLauncher.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemMelonLauncher.java index 8f43f9876..ee0eea7f3 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemMelonLauncher.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemMelonLauncher.java @@ -73,26 +73,26 @@ public class ItemMelonLauncher extends ItemGadget implements IThrown { //Push UtilAction.velocity(target, - UtilAlg.getTrajectory2d(data.GetThrown().getLocation(), target.getLocation()), + UtilAlg.getTrajectory2d(data.getThrown().getLocation(), target.getLocation()), 1.4, false, 0, 0.8, 1.5, true); //Effect target.playEffect(EntityEffect.HURT); } - smash(data.GetThrown()); + smash(data.getThrown()); } @Override public void Idle(ProjectileUser data) { - smash(data.GetThrown()); + smash(data.getThrown()); } @Override public void Expire(ProjectileUser data) { - smash(data.GetThrown()); + smash(data.getThrown()); } public void smash(Entity ent) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPartyPopper.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPartyPopper.java index c3ea07224..0554acfe2 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPartyPopper.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPartyPopper.java @@ -124,20 +124,20 @@ public class ItemPartyPopper extends ItemGadget implements IThrown { for(int type : new int[]{1,2,4,5,6,9,10,11,12,13,14,15}) { - UtilParticle.PlayParticleToAll(ParticleType.ICON_CRACK.getParticle(Material.INK_SACK, type), data.GetThrown().getLocation(), null, 0.4f, 50, ViewDist.LONG); + UtilParticle.PlayParticleToAll(ParticleType.ICON_CRACK.getParticle(Material.INK_SACK, type), data.getThrown().getLocation(), null, 0.4f, 50, ViewDist.LONG); } - data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.LAVA_POP, 0.75f, 1.25f); - data.GetThrown().remove(); + data.getThrown().getWorld().playSound(data.getThrown().getLocation(), Sound.LAVA_POP, 0.75f, 1.25f); + data.getThrown().remove(); /* - if (data.GetThrown() instanceof Item) + if (data.getThrown() instanceof Item) { - Item item = (Item) data.GetThrown(); + Item item = (Item) data.getThrown(); byte b = item.getItemStack().getData().getData(); UtilParticle.PlayParticleToAll(ParticleType.ICON_CRACK.getParticle(Material.INK_SACK, b), item.getLocation(), 0, 0, 0, 0.2f, 80, ViewDist.LONG); _items.remove(item); } - data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.LAVA_POP, 0.75f, 1.25f); - data.GetThrown().remove(); + data.getThrown().getWorld().playSound(data.getThrown().getLocation(), Sound.LAVA_POP, 0.75f, 1.25f); + data.getThrown().remove(); */ } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBat.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBat.java index 2304a7475..7b3e0902c 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBat.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBat.java @@ -134,24 +134,24 @@ public class MorphBat extends MorphGadget implements IThrown target.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, 80, 1), true); //Inform - UtilPlayer.message(target, F.main("Skill", F.name(UtilEnt.getName(data.GetThrower())) + " hit you with " + F.skill("Bat Poop") + ".")); + UtilPlayer.message(target, F.main("Skill", F.name(UtilEnt.getName(data.getThrower())) + " hit you with " + F.skill("Bat Poop") + ".")); - UtilPlayer.message(data.GetThrower(), F.main("Skill", "You hit " + F.name(UtilEnt.getName(target)) + " with " + F.skill("Bat Poop") + ".")); + UtilPlayer.message(data.getThrower(), F.main("Skill", "You hit " + F.name(UtilEnt.getName(target)) + " with " + F.skill("Bat Poop") + ".")); } - data.GetThrown().remove(); + data.getThrown().remove(); } @Override public void Idle(ProjectileUser data) { - data.GetThrown().remove(); + data.getThrown().remove(); } @Override public void Expire(ProjectileUser data) { - data.GetThrown().remove(); + data.getThrown().remove(); } @EventHandler diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphVillager.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphVillager.java index 1fdc71369..b386a6ef5 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphVillager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphVillager.java @@ -114,16 +114,16 @@ public class MorphVillager extends MorphGadget implements IThrown return; if (target instanceof Player) - if (Manager.collideEvent((Player) data.GetThrower(), this, (Player) target)) + if (Manager.collideEvent((Player) data.getThrower(), this, (Player) target)) return; //Pull UtilAction.velocity(target, - UtilAlg.getTrajectory(data.GetThrown().getLocation(), target.getEyeLocation()), + UtilAlg.getTrajectory(data.getThrown().getLocation(), target.getEyeLocation()), 1, false, 0, 0.2, 0.8, true); - UtilAction.velocity(data.GetThrown(), - UtilAlg.getTrajectory(target, data.GetThrown()), + UtilAction.velocity(data.getThrown(), + UtilAlg.getTrajectory(target, data.getThrown()), 0.5, false, 0, 0, 0.8, true); //Effect diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/persistence/UserGadgetPersistence.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/persistence/UserGadgetPersistence.java index ae8918ff5..d2f8f9b67 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/persistence/UserGadgetPersistence.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/persistence/UserGadgetPersistence.java @@ -10,6 +10,7 @@ import mineplex.core.gadget.GadgetManager; import mineplex.core.gadget.types.Gadget; import mineplex.core.gadget.types.GadgetGameModifier; import mineplex.core.gadget.types.GadgetType; +import mineplex.core.gadget.types.OutfitGadget; import org.bukkit.entity.Player; public class UserGadgetPersistence @@ -21,7 +22,7 @@ public class UserGadgetPersistence public UserGadgetPersistence(GadgetManager manager) { _manager = manager; - _repository = new PlayerKeyValueRepository<>("gadgets", PreparedStatement::setString, ResultSet::getString, "VARCHAR(255)"); + _repository = new PlayerKeyValueRepository<>("gadgets", PreparedStatement::setString, ResultSet::getString); } public void load(Player player) @@ -29,38 +30,45 @@ public class UserGadgetPersistence _repository.getAll(player.getUniqueId()).thenCompose(BukkitFuture.accept(values -> { if (player.isOnline()) { - for (GadgetType gadgetType : GadgetType.values()) + for (Gadget gadget : _manager.getAllGadgets()) { + GadgetType gadgetType = gadget.getGadgetType(); switch (gadgetType) { case MusicDisc: case Item: + case Morph: break; case Costume: - String[] costumeParts = new String[] {"activeCostumeHelmet", "activeCostumeChestplate", - "activeCostumeLeggings", "activeCostumeBoots"}; - for (String costumePart : costumeParts) - { - Gadget costumeGadget = _manager.getGadget(values.get(costumePart), gadgetType); - if (costumeGadget != null) - costumeGadget.enable(player); - } + OutfitGadget outfitGadget = (OutfitGadget) gadget; + String key = "activeCostume" + outfitGadget.getSlot().getDatabaseKey(); + if (!values.containsKey(key)) + continue; + if (values.get(key).equals(gadget.getName())) + gadget.enable(player); break; case GameModifier: - List gameModifiers = _manager.getGadgets(gadgetType); - for (Gadget gadget : gameModifiers) + GadgetGameModifier gadgetGameModifier = (GadgetGameModifier) gadget; + if (gadgetGameModifier.canAllowMultiple()) { - GadgetGameModifier gadgetGameModifier = (GadgetGameModifier) gadget; - String key = "active" + gadget.getName().replace(" ", "") + - gadgetGameModifier.getGameType().getName().replace(" ", ""); - if (values.get(key) != null) - if (values.get(key).equalsIgnoreCase("enabled")) - gadget.enable(player); + if (!values.containsKey(gadget.getName())) + continue; + if (values.get(gadget.getName()).equals("enabled")) + gadget.enable(player); + } + else + { + String dataKey = "activeModifier" + gadgetGameModifier.getGameType().getName().replace(" ", ""); + if (!values.containsKey(dataKey)) + continue; + if (values.get(dataKey).equals(gadget.getName())) + gadget.enable(player); } break; default: - Gadget gadget = _manager.getGadget(values.get(gadgetType.getDatabaseKey()), gadgetType); - if (gadget != null) + if (!values.containsKey(gadgetType.getDatabaseKey())) + continue; + if (values.get(gadgetType.getDatabaseKey()).equals(gadget.getName())) gadget.enable(player); break; } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/GadgetGameModifier.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/GadgetGameModifier.java index 916dbefa4..03d060e85 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/GadgetGameModifier.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/GadgetGameModifier.java @@ -15,6 +15,7 @@ public abstract class GadgetGameModifier extends Gadget { protected final GameModifierType _type; + private final boolean _allowMultiple; /** * @param manager Normal GadgetManager @@ -25,16 +26,22 @@ public abstract class GadgetGameModifier extends Gadget * @param mat The display material used in GUIs * @param data The display data used in GUIs */ - public GadgetGameModifier(GadgetManager manager, GameModifierType type, String name, String[] desc, int cost, Material mat, byte data) + public GadgetGameModifier(GadgetManager manager, GameModifierType type, String name, String[] desc, int cost, Material mat, byte data, boolean allowMultiple) { super(manager, GadgetType.GameModifier, name, desc, cost, mat, data); _type = type; + _allowMultiple = allowMultiple; } public GameModifierType getGameType() { return _type; } + + public boolean canAllowMultiple() + { + return _allowMultiple; + } @Override public void enableCustom(Player player) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/OutfitGadget.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/OutfitGadget.java index c8aabba05..77d46f7f1 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/OutfitGadget.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/OutfitGadget.java @@ -12,10 +12,22 @@ public abstract class OutfitGadget extends Gadget { public enum ArmorSlot { - Helmet, - Chest, - Legs, - Boots + Helmet ("Helmet"), + Chest ("Chestplate"), + Legs ("Leggings"), + Boots ("Boots"); + + private String _databaseKey; + + ArmorSlot(String databaseKey) + { + _databaseKey = databaseKey; + } + + public String getDatabaseKey() + { + return _databaseKey; + } } protected ArmorSlot _slot; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/projectile/ProjectileManager.java b/Plugins/Mineplex.Core/src/mineplex/core/projectile/ProjectileManager.java index ceb014de4..12dbee6b4 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/projectile/ProjectileManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/projectile/ProjectileManager.java @@ -10,7 +10,6 @@ import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; -import org.bukkit.Bukkit; import org.bukkit.Effect; import org.bukkit.Sound; import org.bukkit.entity.Entity; @@ -40,7 +39,7 @@ public class ProjectileManager extends MiniPlugin { if (_thrown.containsKey(thrown)) { - return _thrown.get(thrown).GetThrower(); + return _thrown.get(thrown).getThrower(); } return null; @@ -174,14 +173,14 @@ public class ProjectileManager extends MiniPlugin iterator.remove(); continue; } - else if (_thrown.get(cur).Collision()) + else if (_thrown.get(cur).collision()) iterator.remove(); } } //Effects for (ProjectileUser cur : _thrown.values()) - cur.Effect(event); + cur.effect(event); } @EventHandler(priority=EventPriority.LOW) @@ -191,7 +190,7 @@ public class ProjectileManager extends MiniPlugin return; if (_thrown.containsKey(event.getItem())) - if (!_thrown.get(event.getItem()).CanPickup(event.getPlayer())) + if (!_thrown.get(event.getItem()).canPickup(event.getPlayer())) event.setCancelled(true); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/projectile/ProjectileUser.java b/Plugins/Mineplex.Core/src/mineplex/core/projectile/ProjectileUser.java index 8a17080cd..31aee43b1 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/projectile/ProjectileUser.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/projectile/ProjectileUser.java @@ -143,7 +143,7 @@ public class ProjectileUser _canHit = canHit; } - public void Effect(UpdateEvent event) + public void effect(UpdateEvent event) { if (event.getType() != _effectRate) return; @@ -160,7 +160,7 @@ public class ProjectileUser } - public boolean Collision() + public boolean collision() { if (_expireTime != -1 && System.currentTimeMillis() > (_startTime + _expireTime)) { @@ -317,17 +317,17 @@ public class ProjectileUser return _callback; } - public LivingEntity GetThrower() + public LivingEntity getThrower() { return _thrower; } - public Entity GetThrown() + public Entity getThrown() { return _thrown; } - public boolean CanPickup(LivingEntity thrower) + public boolean canPickup(LivingEntity thrower) { if (!thrower.equals(_thrower)) return false; diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/potato/PotatoManager.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/potato/PotatoManager.java index fe8880d24..bc9be3fff 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/potato/PotatoManager.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/potato/PotatoManager.java @@ -119,9 +119,9 @@ public class PotatoManager extends MiniPlugin implements IThrown give(player, 1); } - data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.CHICKEN_EGG_POP, 1f, 1.6f); + data.getThrown().getWorld().playSound(data.getThrown().getLocation(), Sound.CHICKEN_EGG_POP, 1f, 1.6f); - data.GetThrown().remove(); + data.getThrown().remove(); } @Override diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/StackerManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/StackerManager.java index 532058fa2..7684044f2 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/StackerManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/StackerManager.java @@ -302,7 +302,7 @@ public class StackerManager extends MiniPlugin implements IThrown System.out.println("Stacker collide."); //Velocity - UtilAction.velocity(target, UtilAlg.getTrajectory2d(data.GetThrown(), target), 1, true, 0.8, 0, 10, true); + UtilAction.velocity(target, UtilAlg.getTrajectory2d(data.getThrown(), target), 1, true, 0.8, 0, 10, true); Entity rider = target.getPassenger(); while (rider != null) @@ -315,10 +315,10 @@ public class StackerManager extends MiniPlugin implements IThrown rider = rider.getPassenger(); } - UtilPlayer.message(target, F.main("Stacker", F.name(UtilEnt.getName(data.GetThrower())) + " hit you with " + F.name(UtilEnt.getName(data.GetThrown())))); + UtilPlayer.message(target, F.main("Stacker", F.name(UtilEnt.getName(data.getThrower())) + " hit you with " + F.name(UtilEnt.getName(data.getThrown())))); //Effect - data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.HURT_FLESH, 1f, 1f); + data.getThrown().getWorld().playSound(data.getThrown().getLocation(), Sound.HURT_FLESH, 1f, 1f); //Portal Delay Manager.SetPortalDelay(target); diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/BlockToss.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/BlockToss.java index c25d056b8..800547f8b 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/BlockToss.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/BlockToss.java @@ -37,7 +37,6 @@ import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilPlayer; import mineplex.minecraft.game.classcombat.Skill.SkillCharge; import mineplex.minecraft.game.classcombat.Skill.SkillFactory; -import mineplex.minecraft.game.classcombat.Skill.event.BlockTossEvent; import mineplex.minecraft.game.classcombat.Skill.event.BlockTossExpireEvent; import mineplex.minecraft.game.classcombat.Skill.event.BlockTossLandEvent; import mineplex.minecraft.game.classcombat.Skill.event.SkillEvent; @@ -281,19 +280,19 @@ public class BlockToss extends SkillCharge implements IThrown if (target == null) return; - int level = getLevel(data.GetThrower()); + int level = getLevel(data.getThrower()); //Damage Event - Factory.Damage().NewDamageEvent(target, data.GetThrower(), null, - DamageCause.CUSTOM, data.GetThrown().getVelocity().length() * (3 + 0.6 * level), true, true, false, - UtilEnt.getName(data.GetThrower()), GetName()); + Factory.Damage().NewDamageEvent(target, data.getThrower(), null, + DamageCause.CUSTOM, data.getThrown().getVelocity().length() * (3 + 0.6 * level), true, true, false, + UtilEnt.getName(data.getThrower()), GetName()); //Block to Item - if (data.GetThrown() instanceof FallingBlock) + if (data.getThrown() instanceof FallingBlock) { - FallingBlock thrown = (FallingBlock) data.GetThrown(); + FallingBlock thrown = (FallingBlock) data.getThrown(); - FallingBlock newThrown = data.GetThrown().getWorld().spawnFallingBlock(data.GetThrown().getLocation(), thrown.getMaterial(), thrown.getBlockData()); + FallingBlock newThrown = data.getThrown().getWorld().spawnFallingBlock(data.getThrown().getLocation(), thrown.getMaterial(), thrown.getBlockData()); newThrown.setDropItem(false); //Remove Old @@ -301,8 +300,8 @@ public class BlockToss extends SkillCharge implements IThrown thrown.remove(); //Add New - if (data.GetThrower() instanceof Player) - _falling.put(newThrown, (Player)data.GetThrower()); + if (data.getThrower() instanceof Player) + _falling.put(newThrown, (Player)data.getThrower()); } } diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/FleshHook.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/FleshHook.java index ca77c5908..373caea1f 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/FleshHook.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/FleshHook.java @@ -3,7 +3,6 @@ package mineplex.minecraft.game.classcombat.Skill.Brute; import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.block.Block; -import org.bukkit.entity.Entity; import org.bukkit.entity.Item; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; @@ -126,13 +125,13 @@ public class FleshHook extends SkillActiveCharge implements IThrown public void Collide(LivingEntity target, Block block, ProjectileUser data) { //Remove - double velocity = data.GetThrown().getVelocity().length(); - data.GetThrown().remove(); + double velocity = data.getThrown().getVelocity().length(); + data.getThrown().remove(); - if (!(data.GetThrower() instanceof Player)) + if (!(data.getThrower() instanceof Player)) return; - Player player = (Player)data.GetThrower(); + Player player = (Player)data.getThrower(); //Level int level = getLevel(player); @@ -172,13 +171,13 @@ public class FleshHook extends SkillActiveCharge implements IThrown public void Idle(ProjectileUser data) { //Remove - data.GetThrown().remove(); + data.getThrown().remove(); } @Override public void Expire(ProjectileUser data) { //Remove - data.GetThrown().remove(); + data.getThrown().remove(); } } diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Knight/AxeThrow.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Knight/AxeThrow.java index 957f53cb0..bf2d6aa75 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Knight/AxeThrow.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Knight/AxeThrow.java @@ -3,7 +3,6 @@ package mineplex.minecraft.game.classcombat.Skill.Knight; import java.util.HashMap; import java.util.Iterator; -import org.bukkit.Effect; import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.block.Block; @@ -27,7 +26,6 @@ import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilPlayer; import mineplex.core.projectile.IThrown; import mineplex.core.projectile.ProjectileUser; -import mineplex.core.recharge.Recharge; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import mineplex.minecraft.game.classcombat.Skill.SkillActive; @@ -100,33 +98,33 @@ public class AxeThrow extends SkillActive implements IThrown @Override public void Collide(LivingEntity target, Block block, ProjectileUser data) { - Rebound(data.GetThrower(), data.GetThrown()); + Rebound(data.getThrower(), data.getThrown()); if (target == null) return; - int level = getLevel(data.GetThrower()); + int level = getLevel(data.getThrower()); if (level <= 0) return; double damage = 5.5 + 0.5 * level; //Damage Event - Factory.Damage().NewDamageEvent(target, data.GetThrower(), null, + Factory.Damage().NewDamageEvent(target, data.getThrower(), null, DamageCause.CUSTOM, damage, true, true, false, - UtilEnt.getName(data.GetThrower()), GetName()); + UtilEnt.getName(data.getThrower()), GetName()); } @Override public void Idle(ProjectileUser data) { - Rebound(data.GetThrower(), data.GetThrown()); + Rebound(data.getThrower(), data.getThrown()); } @Override public void Expire(ProjectileUser data) { - Rebound(data.GetThrower(), data.GetThrown()); + Rebound(data.getThrower(), data.getThrown()); } public void Rebound(LivingEntity player, Entity ent) diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/FreezingBlast.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/FreezingBlast.java index b78b0c96e..ba21f4252 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/FreezingBlast.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/FreezingBlast.java @@ -100,23 +100,23 @@ public class FreezingBlast extends SkillActive implements IThrown public void Action(LivingEntity target, ProjectileUser data) { //Effect - data.GetThrown().getWorld().playEffect(data.GetThrown().getLocation(), Effect.STEP_SOUND, 79); + data.getThrown().getWorld().playEffect(data.getThrown().getLocation(), Effect.STEP_SOUND, 79); //Remove - data.GetThrown().remove(); + data.getThrown().remove(); //Thrower - if (!(data.GetThrower() instanceof Player)) + if (!(data.getThrower() instanceof Player)) return; - Player player = (Player)data.GetThrower(); + Player player = (Player)data.getThrower(); //Level int level = getLevel(player); if (level == 0) return; //Snow Spread - HashMap blocks = UtilBlock.getInRadius(data.GetThrown().getLocation(), 4d); + HashMap blocks = UtilBlock.getInRadius(data.getThrown().getLocation(), 4d); for (Block cur : blocks.keySet()) { if (UtilBlock.airFoliage(cur) && UtilBlock.solid(cur.getRelative(BlockFace.DOWN))) @@ -127,7 +127,7 @@ public class FreezingBlast extends SkillActive implements IThrown } //Slow Players - for (Player curPlayer : UtilPlayer.getNearby(data.GetThrown().getLocation(), 4)) + for (Player curPlayer : UtilPlayer.getNearby(data.getThrown().getLocation(), 4)) Factory.Condition().Factory().Slow(GetName(), curPlayer, player, 2.9, 0, false, true, true, true); if (target == null) diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/GlacialBlade.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/GlacialBlade.java index 9a8450374..7f9f0b6a7 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/GlacialBlade.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/GlacialBlade.java @@ -7,17 +7,14 @@ import org.bukkit.block.Block; import org.bukkit.entity.Item; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; import org.bukkit.event.block.Action; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; -import org.bukkit.event.player.PlayerCommandPreprocessEvent; import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType; import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.projectile.IThrown; import mineplex.core.projectile.ProjectileUser; import mineplex.core.updater.UpdateType; -import mineplex.core.common.util.F; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilPlayer; @@ -83,38 +80,38 @@ public class GlacialBlade extends SkillActive implements IThrown public void Collide(LivingEntity target, Block block, ProjectileUser data) { //Effect - data.GetThrown().getWorld().playEffect(data.GetThrown().getLocation(), Effect.STEP_SOUND, 20); + data.getThrown().getWorld().playEffect(data.getThrown().getLocation(), Effect.STEP_SOUND, 20); //Remove - data.GetThrown().remove(); + data.getThrown().remove(); if (target == null) return; //Damage - Factory.Damage().NewDamageEvent(target, data.GetThrower(), null, + Factory.Damage().NewDamageEvent(target, data.getThrower(), null, DamageCause.CUSTOM, 3.5, false, true, false, - UtilEnt.getName(data.GetThrower()), GetName()); + UtilEnt.getName(data.getThrower()), GetName()); } @Override public void Idle(ProjectileUser data) { //Effect - data.GetThrown().getWorld().playEffect(data.GetThrown().getLocation(), Effect.STEP_SOUND, 20); + data.getThrown().getWorld().playEffect(data.getThrown().getLocation(), Effect.STEP_SOUND, 20); //Remove - data.GetThrown().remove(); + data.getThrown().remove(); } @Override public void Expire(ProjectileUser data) { //Effect - data.GetThrown().getWorld().playEffect(data.GetThrown().getLocation(), Effect.STEP_SOUND, 20); + data.getThrown().getWorld().playEffect(data.getThrown().getLocation(), Effect.STEP_SOUND, 20); //Remove - data.GetThrown().remove(); + data.getThrown().remove(); } @Override diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/IcePrison.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/IcePrison.java index f2201330b..2c2c0f118 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/IcePrison.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/IcePrison.java @@ -101,22 +101,22 @@ public class IcePrison extends SkillActive implements IThrown public void Action(LivingEntity target, ProjectileUser data) { //Effect - data.GetThrown().getWorld().playEffect(data.GetThrown().getLocation(), Effect.STEP_SOUND, 79); + data.getThrown().getWorld().playEffect(data.getThrown().getLocation(), Effect.STEP_SOUND, 79); //Remove - data.GetThrown().remove(); + data.getThrown().remove(); //Thrower - if (!(data.GetThrower() instanceof Player)) + if (!(data.getThrower() instanceof Player)) return; - Player player = (Player)data.GetThrower(); + Player player = (Player)data.getThrower(); //Level int level = getLevel(player); if (level == 0) return; - Block block = data.GetThrown().getLocation().getBlock(); + Block block = data.getThrown().getLocation().getBlock(); //Sphere HashMap blocks = UtilBlock.getInRadius(block, 3.8d); diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/LightningOrb.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/LightningOrb.java index 17cea9ff8..027fee62a 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/LightningOrb.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/LightningOrb.java @@ -132,20 +132,20 @@ public class LightningOrb extends SkillActive implements IThrown public void Strike(LivingEntity target, ProjectileUser data) { //Remove - data.GetThrown().remove(); + data.getThrown().remove(); //Thrower - if (!(data.GetThrower() instanceof Player)) + if (!(data.getThrower() instanceof Player)) return; - Player player = (Player)data.GetThrower(); + Player player = (Player)data.getThrower(); //Level int level = getLevel(player); if (level == 0) return; - HashMap hit = UtilEnt.getInRadius(data.GetThrown().getLocation(), 3 + 0.5 * level); + HashMap hit = UtilEnt.getInRadius(data.getThrown().getLocation(), 3 + 0.5 * level); List struck = new ArrayList<>(); diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Consume/Apple.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Consume/Apple.java index de226ba57..08d800a16 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Consume/Apple.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Consume/Apple.java @@ -56,18 +56,18 @@ public class Apple extends ItemUsable return; //Damage Event - Factory.Damage().NewDamageEvent(target, data.GetThrower(), null, + Factory.Damage().NewDamageEvent(target, data.getThrower(), null, DamageCause.CUSTOM, 2, true, true, false, - UtilEnt.getName(data.GetThrower()), GetName()); + UtilEnt.getName(data.getThrower()), GetName()); //Effect - data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.CHICKEN_EGG_POP, 1f, 1.6f); + data.getThrown().getWorld().playSound(data.getThrown().getLocation(), Sound.CHICKEN_EGG_POP, 1f, 1.6f); //Re-Drop - if (data.GetThrown() instanceof Item) - data.GetThrown().getWorld().dropItem(data.GetThrown().getLocation(), ItemStackFactory.Instance.CreateStack(((Item)data.GetThrown()).getItemStack().getType())).setPickupDelay(60); + if (data.getThrown() instanceof Item) + data.getThrown().getWorld().dropItem(data.getThrown().getLocation(), ItemStackFactory.Instance.CreateStack(((Item)data.getThrown()).getItemStack().getType())).setPickupDelay(60); - data.GetThrown().remove(); + data.getThrown().remove(); } @Override diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/PoisonBall.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/PoisonBall.java index 111d15db7..08293d5a7 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/PoisonBall.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/PoisonBall.java @@ -39,24 +39,24 @@ public class PoisonBall extends ItemUsable @Override public void Collide(LivingEntity target, Block block, ProjectileUser data) { - Rebound(data.GetThrower(), data.GetThrown()); + Rebound(data.getThrower(), data.getThrown()); if (target == null) return; - Factory.Condition().Factory().Poison(GetName(), target, data.GetThrower(), 6, 0, false, true, true); + Factory.Condition().Factory().Poison(GetName(), target, data.getThrower(), 6, 0, false, true, true); } @Override public void Idle(ProjectileUser data) { - Rebound(data.GetThrower(), data.GetThrown()); + Rebound(data.getThrower(), data.getThrown()); } @Override public void Expire(ProjectileUser data) { - Rebound(data.GetThrower(), data.GetThrown()); + Rebound(data.getThrower(), data.getThrown()); } public void Rebound(LivingEntity player, Entity ent) diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/ProximityExplosive.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/ProximityExplosive.java index a6895deda..017f6c5fe 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/ProximityExplosive.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/ProximityExplosive.java @@ -1,7 +1,6 @@ package mineplex.minecraft.game.classcombat.item.Throwable; import java.util.HashMap; -import java.util.HashSet; import java.util.Iterator; import org.bukkit.Bukkit; @@ -79,33 +78,33 @@ public class ProximityExplosive extends ItemUsable public void Collide(LivingEntity target, Block block, ProjectileUser data) { //Arm - _armed.put(data.GetThrown(), data.GetThrower()); + _armed.put(data.getThrown(), data.getThrower()); //Effect - data.GetThrown().getWorld().playEffect(data.GetThrown().getLocation(), Effect.STEP_SOUND, 7); - data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.NOTE_PLING, 0.5f, 2f); + data.getThrown().getWorld().playEffect(data.getThrown().getLocation(), Effect.STEP_SOUND, 7); + data.getThrown().getWorld().playSound(data.getThrown().getLocation(), Sound.NOTE_PLING, 0.5f, 2f); } @Override public void Idle(ProjectileUser data) { //Arm - _armed.put(data.GetThrown(), data.GetThrower()); + _armed.put(data.getThrown(), data.getThrower()); //Effect - data.GetThrown().getWorld().playEffect(data.GetThrown().getLocation(), Effect.STEP_SOUND, 7); - data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.NOTE_PLING, 0.5f, 2f); + data.getThrown().getWorld().playEffect(data.getThrown().getLocation(), Effect.STEP_SOUND, 7); + data.getThrown().getWorld().playSound(data.getThrown().getLocation(), Sound.NOTE_PLING, 0.5f, 2f); } @Override public void Expire(ProjectileUser data) { //Arm - _armed.put(data.GetThrown(), data.GetThrower()); + _armed.put(data.getThrown(), data.getThrower()); //Effect - data.GetThrown().getWorld().playEffect(data.GetThrown().getLocation(), Effect.STEP_SOUND, 7); - data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.NOTE_PLING, 0.5f, 2f); + data.getThrown().getWorld().playEffect(data.getThrown().getLocation(), Effect.STEP_SOUND, 7); + data.getThrown().getWorld().playSound(data.getThrown().getLocation(), Sound.NOTE_PLING, 0.5f, 2f); } @EventHandler(priority = EventPriority.LOW) diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/ProximityZapper.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/ProximityZapper.java index 3a3c22886..3076b403b 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/ProximityZapper.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/ProximityZapper.java @@ -1,12 +1,10 @@ package mineplex.minecraft.game.classcombat.item.Throwable; import java.util.HashMap; -import java.util.HashSet; import java.util.Iterator; import org.bukkit.Bukkit; import org.bukkit.Effect; -import org.bukkit.GameMode; import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.block.Block; @@ -77,33 +75,33 @@ public class ProximityZapper extends ItemUsable public void Collide(LivingEntity target, Block block, ProjectileUser data) { //Arm - _armed.put(data.GetThrown(), data.GetThrower()); + _armed.put(data.getThrown(), data.getThrower()); //Effect - data.GetThrown().getWorld().playEffect(data.GetThrown().getLocation(), Effect.STEP_SOUND, 7); - data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.NOTE_PLING, 0.5f, 2f); + data.getThrown().getWorld().playEffect(data.getThrown().getLocation(), Effect.STEP_SOUND, 7); + data.getThrown().getWorld().playSound(data.getThrown().getLocation(), Sound.NOTE_PLING, 0.5f, 2f); } @Override public void Idle(ProjectileUser data) { //Arm - _armed.put(data.GetThrown(), data.GetThrower()); + _armed.put(data.getThrown(), data.getThrower()); //Effect - data.GetThrown().getWorld().playEffect(data.GetThrown().getLocation(), Effect.STEP_SOUND, 7); - data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.NOTE_PLING, 0.5f, 2f); + data.getThrown().getWorld().playEffect(data.getThrown().getLocation(), Effect.STEP_SOUND, 7); + data.getThrown().getWorld().playSound(data.getThrown().getLocation(), Sound.NOTE_PLING, 0.5f, 2f); } @Override public void Expire(ProjectileUser data) { //Arm - _armed.put(data.GetThrown(), data.GetThrower()); + _armed.put(data.getThrown(), data.getThrower()); //Effect - data.GetThrown().getWorld().playEffect(data.GetThrown().getLocation(), Effect.STEP_SOUND, 7); - data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.NOTE_PLING, 0.5f, 2f); + data.getThrown().getWorld().playEffect(data.getThrown().getLocation(), Effect.STEP_SOUND, 7); + data.getThrown().getWorld().playSound(data.getThrown().getLocation(), Sound.NOTE_PLING, 0.5f, 2f); } @EventHandler(priority = EventPriority.LOW) diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/WaterBottle.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/WaterBottle.java index 347755706..99361e426 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/WaterBottle.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/WaterBottle.java @@ -80,17 +80,17 @@ public class WaterBottle extends ItemUsable public void Break(ProjectileUser data) { //Splash - data.GetThrown().getWorld().playEffect(data.GetThrown().getLocation(), Effect.STEP_SOUND, 20); - data.GetThrown().getWorld().playEffect(data.GetThrown().getLocation(), Effect.STEP_SOUND, 8); - data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.SPLASH, 1f, 1.4f); + data.getThrown().getWorld().playEffect(data.getThrown().getLocation(), Effect.STEP_SOUND, 20); + data.getThrown().getWorld().playEffect(data.getThrown().getLocation(), Effect.STEP_SOUND, 8); + data.getThrown().getWorld().playSound(data.getThrown().getLocation(), Sound.SPLASH, 1f, 1.4f); //Extinguish - Factory.Fire().RemoveNear(data.GetThrown().getLocation(), 3); + Factory.Fire().RemoveNear(data.getThrown().getLocation(), 3); //Remove - data.GetThrown().remove(); + data.getThrown().remove(); - for (Player player : UtilPlayer.getNearby(data.GetThrown().getLocation(), 3)) + for (Player player : UtilPlayer.getNearby(data.getThrown().getLocation(), 3)) { //Extinguish player.setFireTicks(-20); diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/Web.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/Web.java index a765748d7..023afeb5c 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/Web.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/Web.java @@ -7,7 +7,6 @@ import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.entity.Entity; import org.bukkit.entity.LivingEntity; -import org.bukkit.entity.Player; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.util.Vector; @@ -47,27 +46,27 @@ public class Web extends ItemUsable { if (target != null) { - double distance = UtilMath.offset(target.getLocation(), data.GetThrown().getLocation()); + double distance = UtilMath.offset(target.getLocation(), data.getThrown().getLocation()); if (distance > .75) { - data.GetThrown().teleport(data.GetThrown().getLocation().add(new Vector(0, -distance / 2, 0))); + data.getThrown().teleport(data.getThrown().getLocation().add(new Vector(0, -distance / 2, 0))); } } - CreateWeb(data.GetThrown()); + CreateWeb(data.getThrown()); } @Override public void Idle(ProjectileUser data) { - CreateWeb(data.GetThrown()); + CreateWeb(data.getThrown()); } @Override public void Expire(ProjectileUser data) { - CreateWeb(data.GetThrown()); + CreateWeb(data.getThrown()); } public void CreateWeb(Entity ent) diff --git a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/slimeking/ability/RocketAbility.java b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/slimeking/ability/RocketAbility.java index 2675c0530..d77b039ef 100644 --- a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/slimeking/ability/RocketAbility.java +++ b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/slimeking/ability/RocketAbility.java @@ -109,27 +109,27 @@ public class RocketAbility extends SlimeAbility implements IThrown public void Collide(LivingEntity target, Block block, ProjectileUser data) { // Bukkit.broadcastMessage("COLLIDE " + target); - UtilParticle.PlayParticle(UtilParticle.ParticleType.LARGE_EXPLODE, data.GetThrown().getLocation(), 0, 0, 0, 0, 1, UtilParticle.ViewDist.LONG, UtilServer.getPlayers()); + UtilParticle.PlayParticle(UtilParticle.ParticleType.LARGE_EXPLODE, data.getThrown().getLocation(), 0, 0, 0, 0, 1, UtilParticle.ViewDist.LONG, UtilServer.getPlayers()); target.getLocation().getWorld().playSound(target.getLocation(), Sound.SPLASH, 1, 2); getSlime().getEvent().getDamageManager().NewDamageEvent(target, getSlime().getEntity(), null, EntityDamageEvent.DamageCause.PROJECTILE, 3 + getSlime().getSize() * 3, true, true, false, getSlime().getName(), "Slime Rocket"); - data.GetThrown().remove(); + data.getThrown().remove(); _rocketsHit++; } @Override public void Idle(ProjectileUser data) { - data.GetThrown().remove(); + data.getThrown().remove(); _rocketsHit++; } @Override public void Expire(ProjectileUser data) { - data.GetThrown().remove(); + data.getThrown().remove(); _rocketsHit++; } diff --git a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/spider/attacks/SpiderPoison.java b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/spider/attacks/SpiderPoison.java index ec57283bb..3135945b0 100644 --- a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/spider/attacks/SpiderPoison.java +++ b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/spider/attacks/SpiderPoison.java @@ -3,7 +3,6 @@ package mineplex.minecraft.game.core.boss.spider.attacks; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.entity.Entity; -import org.bukkit.entity.Item; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; @@ -12,7 +11,6 @@ import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; -import mineplex.core.disguise.disguises.DisguiseSlime; import mineplex.core.projectile.IThrown; import mineplex.core.projectile.ProjectileUser; import mineplex.minecraft.game.core.boss.EventCreature; @@ -53,9 +51,9 @@ public class SpiderPoison implements IThrown private void burst(ProjectileUser data) { - data.GetThrown().remove(); + data.getThrown().remove(); - UtilParticle.PlayParticle(ParticleType.ICON_CRACK.getParticle(Material.SLIME_BALL, 0), data.GetThrown().getLocation(), + UtilParticle.PlayParticle(ParticleType.ICON_CRACK.getParticle(Material.SLIME_BALL, 0), data.getThrown().getLocation(), 0.3F, 0.3F, 0.3F, 0, 30, ViewDist.NORMAL, UtilServer.getPlayers()); } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkBlockTossEVO.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkBlockTossEVO.java index e1d90d398..1ed85835a 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkBlockTossEVO.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkBlockTossEVO.java @@ -175,24 +175,24 @@ public class PerkBlockTossEVO extends Perk implements IThrown return; //Damage Event - Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null, - DamageCause.PROJECTILE, data.GetThrown().getVelocity().length() * 4, true, true, false, - UtilEnt.getName(data.GetThrower()), GetName()); + Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, + DamageCause.PROJECTILE, data.getThrown().getVelocity().length() * 4, true, true, false, + UtilEnt.getName(data.getThrower()), GetName()); //Block to Item - if (data.GetThrown() instanceof FallingBlock) + if (data.getThrown() instanceof FallingBlock) { - FallingBlock thrown = (FallingBlock) data.GetThrown(); + FallingBlock thrown = (FallingBlock) data.getThrown(); - FallingBlock newThrown = data.GetThrown().getWorld().spawnFallingBlock(data.GetThrown().getLocation(), thrown.getMaterial(), (byte)0); + FallingBlock newThrown = data.getThrown().getWorld().spawnFallingBlock(data.getThrown().getLocation(), thrown.getMaterial(), (byte)0); //Remove Old _falling.remove(thrown); thrown.remove(); //Add New - if (data.GetThrower() instanceof Player) - _falling.put(newThrown, (Player)data.GetThrower()); + if (data.getThrower() instanceof Player) + _falling.put(newThrown, (Player)data.getThrower()); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkSulphurBombEVO.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkSulphurBombEVO.java index 504ee6d9a..4baac10db 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkSulphurBombEVO.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkSulphurBombEVO.java @@ -103,9 +103,9 @@ public class PerkSulphurBombEVO extends Perk implements IThrown return; //Damage Event - Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null, + Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.PROJECTILE, 5, true, true, false, - UtilEnt.getName(data.GetThrower()), GetName()); + UtilEnt.getName(data.getThrower()), GetName()); } @Override @@ -122,10 +122,10 @@ public class PerkSulphurBombEVO extends Perk implements IThrown public void Explode(ProjectileUser data) { - UtilParticle.PlayParticle(ParticleType.LARGE_EXPLODE, data.GetThrown().getLocation(), 0, 0, 0, 0, 1, + UtilParticle.PlayParticle(ParticleType.LARGE_EXPLODE, data.getThrown().getLocation(), 0, 0, 0, 0, 1, ViewDist.MAX, UtilServer.getPlayers()); - data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.EXPLODE, 1f, 1.5f); - data.GetThrown().remove(); + data.getThrown().getWorld().playSound(data.getThrown().getLocation(), Sound.EXPLODE, 1f, 1.5f); + data.getThrown().remove(); } @EventHandler diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkWebEVO.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkWebEVO.java index a1ef621a3..a23144570 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkWebEVO.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkWebEVO.java @@ -85,7 +85,7 @@ public class PerkWebEVO extends Perk implements IThrown { if (Manager.GetGame().IsAlive((Player)target)) { - Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null, DamageCause.CUSTOM, 8, false, false, false, "Web Shot", "Webbed Net"); + Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.CUSTOM, 8, false, false, false, "Web Shot", "Webbed Net"); target.playEffect(EntityEffect.HURT); } else @@ -112,9 +112,9 @@ public class PerkWebEVO extends Perk implements IThrown public void Web(ProjectileUser data) { - Location loc = data.GetThrown().getLocation(); + Location loc = data.getThrown().getLocation(); - data.GetThrown().remove(); + data.getThrown().remove(); if (loc.getBlock().getType() != Material.AIR) return; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/lobbers/BombLobbers.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/lobbers/BombLobbers.java index 93d9bb2bd..10b5abe6a 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/lobbers/BombLobbers.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/lobbers/BombLobbers.java @@ -566,26 +566,26 @@ public class BombLobbers extends TeamGame implements IThrown @Override public void Collide(LivingEntity target, Block block, ProjectileUser data) { - if (!(data.GetThrown() instanceof TNTPrimed)) + if (!(data.getThrown() instanceof TNTPrimed)) return; - if (!(data.GetThrower() instanceof Player)) + if (!(data.getThrower() instanceof Player)) return; if (!(target instanceof Player)) return; - if (GetTeam((Player) target) == GetTeam((Player) data.GetThrower())) + if (GetTeam((Player) target) == GetTeam((Player) data.getThrower())) return; - data.GetThrown().setVelocity(new Vector()); + data.getThrown().setVelocity(new Vector()); if (target != null) - UtilAction.velocity(target, UtilAlg.getTrajectory2d(data.GetThrown().getLocation(), target.getLocation()), .2, false, 0, 0.2, .4, true); + UtilAction.velocity(target, UtilAlg.getTrajectory2d(data.getThrown().getLocation(), target.getLocation()), .2, false, 0, 0.2, .4, true); - Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null, DamageCause.PROJECTILE, 10.0, false, false, false, "Throwing TNT", "Throwing TNT Direct Hit"); + Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.PROJECTILE, 10.0, false, false, false, "Throwing TNT", "Throwing TNT Direct Hit"); - AddGems((Player) data.GetThrower(), 4.0, "Direct Hit", true, true); + AddGems((Player) data.getThrower(), 4.0, "Direct Hit", true, true); } @Override diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/runner/Runner.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/runner/Runner.java index 10f901cd1..a8ecdc232 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/runner/Runner.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/runner/Runner.java @@ -310,18 +310,18 @@ public class Runner extends SoloGame implements IThrown return; } - if (target.getLocation().getY() > data.GetThrown().getLocation().getY() + 0.5) + if (target.getLocation().getY() > data.getThrown().getLocation().getY() + 0.5) { return; } } //Damage Event - Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null, + Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.ENTITY_ATTACK, 6, true, true, false, "Falling Block", "Falling Block"); - BlockSmash(data.GetThrown()); + BlockSmash(data.getThrown()); } @Override diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/PerkFishFlurry.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/PerkFishFlurry.java index 29fd02576..6ca0a54e1 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/PerkFishFlurry.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/PerkFishFlurry.java @@ -173,26 +173,26 @@ public class PerkFishFlurry extends SmashPerk implements IThrown if (target != null) { //Damage Event - Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null, + Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.PROJECTILE, 3, true, true, false, - UtilEnt.getName(data.GetThrower()), GetName()); + UtilEnt.getName(data.getThrower()), GetName()); UtilParticle.PlayParticle(ParticleType.EXPLODE, target.getLocation().add(0, 1, 0), 1f, 1f, 1f, 0, 12, ViewDist.LONG, UtilServer.getPlayers()); } - data.GetThrown().remove(); + data.getThrown().remove(); } @Override public void Idle(ProjectileUser data) { - data.GetThrown().remove(); + data.getThrown().remove(); } @Override public void Expire(ProjectileUser data) { - data.GetThrown().remove(); + data.getThrown().remove(); } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/stacker/Stacker.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/stacker/Stacker.java index 93fd43c1e..99bd044f1 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/stacker/Stacker.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/stacker/Stacker.java @@ -170,14 +170,14 @@ public class Stacker extends SoloGame implements IThrown hit = hit.getVehicle(); //Hit Own Stack > Rethrow - if (hit.equals(data.GetThrower())) + if (hit.equals(data.getThrower())) { - Manager.GetProjectile().AddThrow(data.GetThrown(), data.GetThrower(), this, -1, true, false, true, false, 1f); + Manager.GetProjectile().AddThrow(data.getThrown(), data.getThrower(), this, -1, true, false, true, false, 1f); return; } //Velocity on base component - UtilAction.velocity(hit, UtilAlg.getTrajectory2d(data.GetThrown(), target), 1, true, 0.8, 0, 10, true); + UtilAction.velocity(hit, UtilAlg.getTrajectory2d(data.getThrown(), target), 1, true, 0.8, 0, 10, true); //Shuffle Up Entity top = target; @@ -192,10 +192,10 @@ public class Stacker extends SoloGame implements IThrown rider = rider.getPassenger(); } - UtilPlayer.message(target, F.main("Game", F.name(UtilEnt.getName(data.GetThrower())) + " hit you with " + F.name(UtilEnt.getName(data.GetThrown())))); + UtilPlayer.message(target, F.main("Game", F.name(UtilEnt.getName(data.getThrower())) + " hit you with " + F.name(UtilEnt.getName(data.getThrown())))); //Effect - data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.HURT_FLESH, 1f, 1f); + data.getThrown().getWorld().playSound(data.getThrown().getLocation(), Sound.HURT_FLESH, 1f, 1f); } @Override diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/kit/KitBeastmaster.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/kit/KitBeastmaster.java index 586bd9167..55b003818 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/kit/KitBeastmaster.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/kit/KitBeastmaster.java @@ -24,7 +24,7 @@ public class KitBeastmaster extends Kit new Perk[] { - new PerkWolfPet(30, 1, false, true) + new PerkWolfPet(manager, 30, 1, false, true) }, EntityType.ZOMBIE, new ItemStack(Material.BONE)); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/kit/KitHorseman.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/kit/KitHorseman.java index dbf7f7638..4cc345f76 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/kit/KitHorseman.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/kit/KitHorseman.java @@ -25,7 +25,7 @@ public class KitHorseman extends Kit new Perk[] { - new PerkHorsePet() + new PerkHorsePet(manager) }, EntityType.HORSE, new ItemStack(Material.DIAMOND_BARDING)); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/kit/KitNecromancer.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/kit/KitNecromancer.java index fdedd9874..c34dd187b 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/kit/KitNecromancer.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/kit/KitNecromancer.java @@ -24,7 +24,7 @@ public class KitNecromancer extends Kit new Perk[] { - new PerkSkeletons(true) + new PerkSkeletons(manager, true) }, EntityType.ZOMBIE, new ItemStack(Material.SKULL_ITEM)); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellIcePrison.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellIcePrison.java index baabb5ae0..8fdab34d3 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellIcePrison.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellIcePrison.java @@ -67,7 +67,7 @@ public class SpellIcePrison extends Spell implements SpellClick, IThrown @Override public void Collide(LivingEntity target, Block block, ProjectileUser data) { - if (target != data.GetThrower()) + if (target != data.getThrower()) { IcePrison(data); } @@ -81,11 +81,11 @@ public class SpellIcePrison extends Spell implements SpellClick, IThrown public void IcePrison(ProjectileUser data) { - Location loc = data.GetThrown().getLocation(); - data.GetThrown().remove(); + Location loc = data.getThrown().getLocation(); + data.getThrown().remove(); HashMap blocks = UtilBlock.getInRadius(loc.getBlock(), - data.GetThrown().getMetadata("PrisonStrength").get(0).asDouble(), true); + data.getThrown().getMetadata("PrisonStrength").get(0).asDouble(), true); for (Block block : blocks.keySet()) { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellIceShards.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellIceShards.java index 94181f076..aad833881 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellIceShards.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellIceShards.java @@ -85,7 +85,7 @@ public class SpellIceShards extends Spell implements SpellClick, IThrown // Damage Event Wizards.getArcadeManager() .GetDamage() - .NewDamageEvent(target, data.GetThrower(), null, DamageCause.PROJECTILE, 4 /*+ (timesHit * 2)*/, true, true, + .NewDamageEvent(target, data.getThrower(), null, DamageCause.PROJECTILE, 4 /*+ (timesHit * 2)*/, true, true, false, "Ice Shard", "Ice Shard"); } @@ -95,8 +95,8 @@ public class SpellIceShards extends Spell implements SpellClick, IThrown private void handleShard(ProjectileUser data) { - data.GetThrown().remove(); - Location loc = data.GetThrown().getLocation(); + data.getThrown().remove(); + Location loc = data.getThrown().getLocation(); UtilParticle.PlayParticle(ParticleType.BLOCK_CRACK.getParticle(Material.PACKED_ICE, 0), loc, 0.3F, 0.3F, 0.3F, 0, 12, ViewDist.LONG, UtilServer.getPlayers()); @@ -118,7 +118,7 @@ public class SpellIceShards extends Spell implements SpellClick, IThrown } } - _lastParticles.remove(data.GetThrown()); + _lastParticles.remove(data.getThrown()); } @EventHandler diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellWebShot.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellWebShot.java index 73e1f544b..567078d29 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellWebShot.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellWebShot.java @@ -19,7 +19,6 @@ import org.bukkit.Sound; import org.bukkit.block.Block; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; -import org.bukkit.event.entity.EntityDamageEvent.DamageCause; public class SpellWebShot extends Spell implements SpellClick, IThrown { @@ -67,9 +66,9 @@ public class SpellWebShot extends Spell implements SpellClick, IThrown @Override public void Collide(LivingEntity target, Block block, ProjectileUser data) { - if (target != data.GetThrower()) + if (target != data.getThrower()) { - Location loc = data.GetThrown().getLocation(); + Location loc = data.getThrown().getLocation(); if (target != null) { @@ -94,7 +93,7 @@ public class SpellWebShot extends Spell implements SpellClick, IThrown // Damage Event /* Wizards.getArcadeManager() .GetDamage() - .NewDamageEvent(target, data.GetThrower(), null, DamageCause.PROJECTILE, 2, false, false, false, + .NewDamageEvent(target, data.getThrower(), null, DamageCause.PROJECTILE, 2, false, false, false, "Web Shot", "Web Shot");*/ } @@ -149,18 +148,18 @@ public class SpellWebShot extends Spell implements SpellClick, IThrown @Override public void Idle(ProjectileUser data) { - Web(data, data.GetThrown().getLocation()); + Web(data, data.getThrown().getLocation()); } @Override public void Expire(ProjectileUser data) { - Web(data, data.GetThrown().getLocation()); + Web(data, data.getThrown().getLocation()); } public void Web(ProjectileUser data, Location loc) { - data.GetThrown().remove(); + data.getThrown().remove(); Block block = getValidLocation(loc); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkApple.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkApple.java index b17f86772..559fb6040 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkApple.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkApple.java @@ -1,5 +1,8 @@ package nautilus.game.arcade.kit.perks; +import mineplex.core.gadget.gadgets.gamemodifiers.kits.KitModifier; +import mineplex.core.gadget.gadgets.gamemodifiers.kits.KitModifierType; +import nautilus.game.arcade.ArcadeManager; import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.block.Block; @@ -21,19 +24,21 @@ import mineplex.core.projectile.ProjectileUser; import mineplex.core.recharge.Recharge; import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.UpdateType; -import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.kit.Perk; public class PerkApple extends Perk implements IThrown { - public PerkApple(ArcadeManager manager) + private final ArcadeManager _manager; + + public PerkApple(ArcadeManager manager) { super("Apple Thrower", new String[] { C.cGray + "Receive 1 Apple every 10 seconds", C.cYellow + "Left-Click" + C.cGray + " with Apple to " + C.cGreen + "Throw Apple", }); + _manager = manager; } @EventHandler @@ -53,10 +58,10 @@ public class PerkApple extends Perk implements IThrown if (!Manager.GetGame().IsAlive(player)) continue; - if (!Recharge.Instance.use(player, "Apple Spawn", 10000, false, false)) + if (!Recharge.Instance.use(player, getMessage(player), 10000, false, false)) continue; - player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(260)); + player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(getMaterial(player))); player.playSound(player.getLocation(), Sound.ITEM_PICKUP, 2f, 1f); } } @@ -70,7 +75,7 @@ public class PerkApple extends Perk implements IThrown if (event.getPlayer().getItemInHand() == null) return; - if (event.getPlayer().getItemInHand().getType() != Material.APPLE) + if (event.getPlayer().getItemInHand().getType() != getMaterial(event.getPlayer())) return; Player player = event.getPlayer(); @@ -80,10 +85,10 @@ public class PerkApple extends Perk implements IThrown event.setCancelled(true); - UtilInv.remove(player, Material.APPLE, (byte)0, 1); + UtilInv.remove(player, getMaterial(player), (byte)0, 1); UtilInv.Update(player); - org.bukkit.entity.Item ent = player.getWorld().dropItem(player.getEyeLocation(), ItemStackFactory.Instance.CreateStack(Material.APPLE)); + org.bukkit.entity.Item ent = player.getWorld().dropItem(player.getEyeLocation(), ItemStackFactory.Instance.CreateStack(getMaterial(player))); UtilAction.velocity(ent, player.getLocation().getDirection(), 1.2, false, 0, 0.2, 10, false); Manager.GetProjectile().AddThrow(ent, player, this, -1, true, true, true, false, 0.5f); } @@ -96,25 +101,25 @@ public class PerkApple extends Perk implements IThrown if (target instanceof Player) { - if (!Manager.GetGame().IsAlive((Player)target)) + if (!Manager.GetGame().IsAlive(target)) { return; } } //Damage Event - Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null, + Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.CUSTOM, 3, true, false, false, - UtilEnt.getName(data.GetThrower()), GetName()); + UtilEnt.getName(data.getThrower()), GetName()); //Effect - data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.CHICKEN_EGG_POP, 1f, 1.6f); + data.getThrown().getWorld().playSound(data.getThrown().getLocation(), Sound.CHICKEN_EGG_POP, 1f, 1.6f); //Re-Drop - if (data.GetThrown() instanceof Item) - data.GetThrown().getWorld().dropItem(data.GetThrown().getLocation(), ItemStackFactory.Instance.CreateStack(Material.APPLE)).setPickupDelay(60); + if (data.getThrown() instanceof Item && data.getThrown() instanceof Player) + data.getThrown().getWorld().dropItem(data.getThrown().getLocation(), ItemStackFactory.Instance.CreateStack(getMaterial((Player) data.getThrower()))).setPickupDelay(60); - data.GetThrown().remove(); + data.getThrown().remove(); } @Override @@ -128,4 +133,22 @@ public class PerkApple extends Perk implements IThrown { } + + private Material getMaterial(Player player) + { + if (_manager.getCosmeticManager().getGadgetManager().isKitModifierActive(KitModifier.Bridges_Apple_Potato, player)) + { + return Material.POTATO_ITEM; + } + return Material.APPLE; + } + + private String getMessage(Player player) + { + if (_manager.getCosmeticManager().getGadgetManager().isKitModifierActive(KitModifier.Bridges_Apple_Potato, player)) + { + return "Potato Spawn"; + } + return "Apple Spawn"; + } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkAxeThrower.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkAxeThrower.java index 5878156a5..552e5c6ad 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkAxeThrower.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkAxeThrower.java @@ -74,7 +74,7 @@ public class PerkAxeThrower extends Perk implements IThrown if (!Manager.GetGame().IsAlive((Player)target)) return; - Item item = (Item)data.GetThrown(); + Item item = (Item)data.getThrown(); int damage = 4; if (item.getItemStack().getType() == Material.STONE_AXE) damage = 5; @@ -82,18 +82,18 @@ public class PerkAxeThrower extends Perk implements IThrown else if (item.getItemStack().getType() == Material.DIAMOND_AXE) damage = 7; //Damage Event - Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null, + Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.CUSTOM, damage, true, true, false, - UtilEnt.getName(data.GetThrower()), GetName()); + UtilEnt.getName(data.getThrower()), GetName()); //Effect - data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.ZOMBIE_WOOD, 1f, 1.6f); + data.getThrown().getWorld().playSound(data.getThrown().getLocation(), Sound.ZOMBIE_WOOD, 1f, 1.6f); //Re-Drop - data.GetThrown().getWorld().dropItem(data.GetThrown().getLocation(), ItemStackFactory.Instance.CreateStack(item.getItemStack().getType())).setPickupDelay(60); + data.getThrown().getWorld().dropItem(data.getThrown().getLocation(), ItemStackFactory.Instance.CreateStack(item.getItemStack().getType())).setPickupDelay(60); //Remove - data.GetThrown().remove(); + data.getThrown().remove(); } @Override diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBaconBlast.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBaconBlast.java index 89ff68f52..a24bec73d 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBaconBlast.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBaconBlast.java @@ -89,9 +89,9 @@ public class PerkBaconBlast extends Perk implements IThrown return; //Damage Event - Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null, + Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.PROJECTILE, 6, true, true, false, - UtilEnt.getName(data.GetThrower()), GetName()); + UtilEnt.getName(data.getThrower()), GetName()); } @Override @@ -109,8 +109,8 @@ public class PerkBaconBlast extends Perk implements IThrown public void Explode(ProjectileUser data) { // for whatever reason, you can't put a location in createExplosion if you don't want it to break blocks >.> - Location loc = data.GetThrown().getLocation(); - data.GetThrown().getWorld().createExplosion(loc.getX(), loc.getY(), loc.getZ(), 0.5f, false, false); - data.GetThrown().remove(); + Location loc = data.getThrown().getLocation(); + data.getThrown().getWorld().createExplosion(loc.getX(), loc.getY(), loc.getZ(), 0.5f, false, false); + data.getThrown().remove(); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBlockRestorer.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBlockRestorer.java index 16e17e38d..c4c754d8f 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBlockRestorer.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBlockRestorer.java @@ -66,19 +66,19 @@ public class PerkBlockRestorer extends Perk implements IThrown @Override public void Collide(LivingEntity target, Block block, ProjectileUser data) { - restore(data.GetThrown()); + restore(data.getThrown()); } @Override public void Idle(ProjectileUser data) { - restore(data.GetThrown()); + restore(data.getThrown()); } @Override public void Expire(ProjectileUser data) { - restore(data.GetThrown()); + restore(data.getThrown()); } public void restore(Entity entity) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBlockToss.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBlockToss.java index f74e03053..83870c9d9 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBlockToss.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBlockToss.java @@ -166,24 +166,24 @@ public class PerkBlockToss extends SmashPerk implements IThrown return; //Damage Event - Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null, - DamageCause.PROJECTILE, data.GetThrown().getVelocity().length() * 10, true, true, false, - UtilEnt.getName(data.GetThrower()), GetName()); + Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, + DamageCause.PROJECTILE, data.getThrown().getVelocity().length() * 10, true, true, false, + UtilEnt.getName(data.getThrower()), GetName()); //Block to Item - if (data.GetThrown() instanceof FallingBlock) + if (data.getThrown() instanceof FallingBlock) { - FallingBlock thrown = (FallingBlock) data.GetThrown(); + FallingBlock thrown = (FallingBlock) data.getThrown(); - FallingBlock newThrown = data.GetThrown().getWorld().spawnFallingBlock(data.GetThrown().getLocation(), thrown.getMaterial(), (byte)0); + FallingBlock newThrown = data.getThrown().getWorld().spawnFallingBlock(data.getThrown().getLocation(), thrown.getMaterial(), (byte)0); //Remove Old _falling.remove(thrown); thrown.remove(); //Add New - if (data.GetThrower() instanceof Player) - _falling.put(newThrown, (Player)data.GetThrower()); + if (data.getThrower() instanceof Player) + _falling.put(newThrown, (Player)data.getThrower()); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBoneRush.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBoneRush.java index 3bee3341d..4a5790f73 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBoneRush.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBoneRush.java @@ -141,12 +141,12 @@ public class PerkBoneRush extends SmashPerk implements IThrown @Override public void Collide(LivingEntity target, Block block, ProjectileUser data) { - data.GetThrown().remove(); + data.getThrown().remove(); if (target == null) return; - Player damager = (Player)data.GetThrower(); + Player damager = (Player)data.getThrower(); double damage = 0.7; String reason = GetName(); @@ -158,23 +158,23 @@ public class PerkBoneRush extends SmashPerk implements IThrown } //Damage Event - Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null, + Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.CUSTOM, damage, false, true, false, - UtilEnt.getName(data.GetThrower()), reason); + UtilEnt.getName(data.getThrower()), reason); - UtilAction.velocity(target, data.GetThrown().getVelocity()); + UtilAction.velocity(target, data.getThrown().getVelocity()); } @Override public void Idle(ProjectileUser data) { - data.GetThrown().remove(); + data.getThrown().remove(); } @Override public void Expire(ProjectileUser data) { - data.GetThrown().remove(); + data.getThrown().remove(); } @EventHandler diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkCowBomb.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkCowBomb.java index e3461cd2f..535dc0ca5 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkCowBomb.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkCowBomb.java @@ -96,9 +96,9 @@ public class PerkCowBomb extends Perk implements IThrown return; //Damage Event - Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null, + Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.PROJECTILE, 4, true, true, false, - UtilEnt.getName(data.GetThrower()), GetName()); + UtilEnt.getName(data.getThrower()), GetName()); } @Override @@ -116,11 +116,11 @@ public class PerkCowBomb extends Perk implements IThrown public void Explode(ProjectileUser data) { //Effect - data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.COW_HURT, 2f, 1.2f); - data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.COW_HURT, 2f, 1.2f); + data.getThrown().getWorld().playSound(data.getThrown().getLocation(), Sound.COW_HURT, 2f, 1.2f); + data.getThrown().getWorld().playSound(data.getThrown().getLocation(), Sound.COW_HURT, 2f, 1.2f); - data.GetThrown().getWorld().createExplosion(data.GetThrown().getLocation(), 0.5f); - data.GetThrown().remove(); + data.getThrown().getWorld().createExplosion(data.getThrown().getLocation(), 0.5f); + data.getThrown().remove(); } @EventHandler diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkCreeperSulphurBomb.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkCreeperSulphurBomb.java index e9759b073..c1d93f7b7 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkCreeperSulphurBomb.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkCreeperSulphurBomb.java @@ -27,7 +27,6 @@ import mineplex.core.projectile.ProjectileUser; import mineplex.core.recharge.Recharge; import mineplex.core.updater.UpdateType; import mineplex.minecraft.game.core.damage.CustomDamageEvent; -import nautilus.game.arcade.kit.Perk; import nautilus.game.arcade.kit.SmashPerk; public class PerkCreeperSulphurBomb extends SmashPerk implements IThrown @@ -99,9 +98,9 @@ public class PerkCreeperSulphurBomb extends SmashPerk implements IThrown return; //Damage Event - Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null, + Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.PROJECTILE, 7, true, true, false, - UtilEnt.getName(data.GetThrower()), GetName()); + UtilEnt.getName(data.getThrower()), GetName()); } @Override @@ -118,10 +117,10 @@ public class PerkCreeperSulphurBomb extends SmashPerk implements IThrown public void Explode(ProjectileUser data) { - UtilParticle.PlayParticle(ParticleType.LARGE_EXPLODE, data.GetThrown().getLocation(), 0, 0, 0, 0, 1, + UtilParticle.PlayParticle(ParticleType.LARGE_EXPLODE, data.getThrown().getLocation(), 0, 0, 0, 0, 1, ViewDist.MAX, UtilServer.getPlayers()); - data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.EXPLODE, 1f, 1.5f); - data.GetThrown().remove(); + data.getThrown().getWorld().playSound(data.getThrown().getLocation(), Sound.EXPLODE, 1f, 1.5f); + data.getThrown().remove(); } @EventHandler diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHammerThrow.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHammerThrow.java index 6abfaf5d1..10c87bc33 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHammerThrow.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHammerThrow.java @@ -130,7 +130,7 @@ public class PerkHammerThrow extends Perk implements IThrown @Override public void Collide(LivingEntity target, Block block, ProjectileUser data) { - Rebound(data.GetThrower(), data.GetThrown()); + Rebound(data.getThrower(), data.getThrown()); if (target == null) return; @@ -140,21 +140,21 @@ public class PerkHammerThrow extends Perk implements IThrown damage = 8; //Damage Event - Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null, + Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.LIGHTNING, damage, true, true, false, - UtilEnt.getName(data.GetThrower()), GetName()); + UtilEnt.getName(data.getThrower()), GetName()); } @Override public void Idle(ProjectileUser data) { - Rebound(data.GetThrower(), data.GetThrown()); + Rebound(data.getThrower(), data.getThrown()); } @Override public void Expire(ProjectileUser data) { - Rebound(data.GetThrower(), data.GetThrown()); + Rebound(data.getThrower(), data.getThrown()); } public void Rebound(LivingEntity player, Entity ent) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHorsePet.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHorsePet.java index 19133d9b3..fde17d8b0 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHorsePet.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHorsePet.java @@ -3,7 +3,10 @@ package nautilus.game.arcade.kit.perks; import java.util.HashMap; import java.util.Iterator; -import org.bukkit.Bukkit; +import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.gadgets.gamemodifiers.kits.KitModifier; +import mineplex.core.gadget.gadgets.gamemodifiers.kits.KitModifierType; +import nautilus.game.arcade.ArcadeManager; import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.entity.Entity; @@ -31,16 +34,17 @@ import nautilus.game.arcade.kit.Perk; public class PerkHorsePet extends Perk { + private ArcadeManager _manager; private HashMap _horseMap = new HashMap(); private HashMap _deathTime = new HashMap(); - public PerkHorsePet() + public PerkHorsePet(ArcadeManager manager) { super("Horse Master", new String[] { C.cGray + "You have a loyal horse companion.", }); - + _manager = manager; //Bukkit.getPluginManager().registerEvents(this, Manager.getPlugin()); } @@ -63,7 +67,32 @@ public class PerkHorsePet extends Perk horse.setAgeLock(true); horse.setColor(Color.BROWN); horse.setStyle(Style.NONE); - horse.setVariant(Variant.HORSE); + KitModifier kitModifier = getHorseType(player); + if (kitModifier != null) + { + switch (getHorseType(player)) + { + case Survival_Games_Horseman_Mule: + horse.setVariant(Variant.MULE); + break; + case Survival_Games_Horseman_Skeleton_Horse: + horse.setVariant(Variant.SKELETON_HORSE); + break; + case Survival_Games_Horseman_Zombie_Horse: + horse.setVariant(Variant.UNDEAD_HORSE); + break; + case Survival_Games_Horseman_Donkey: + horse.setVariant(Variant.DONKEY); + break; + default: + horse.setVariant(Variant.HORSE); + break; + } + } + else + { + horse.setVariant(Variant.HORSE); + } horse.setOwner(player); horse.setMaxDomestication(1); horse.setJumpStrength(1); @@ -228,4 +257,10 @@ public class PerkHorsePet extends Perk return; } } + + private KitModifier getHorseType(Player player) + { + GadgetManager gadgetManager = _manager.getCosmeticManager().getGadgetManager(); + return gadgetManager.getActiveKitModifier(KitModifierType.SurvivalGames_HorsemanKit, player); + } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkInkBlast.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkInkBlast.java index fee34747e..bc40a81ae 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkInkBlast.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkInkBlast.java @@ -1,6 +1,5 @@ package nautilus.game.arcade.kit.perks; -import org.bukkit.Effect; import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.block.Block; @@ -118,9 +117,9 @@ public class PerkInkBlast extends SmashPerk implements IThrown return; //Damage Event - Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null, + Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.PROJECTILE, _damagePerBullet, true, true, false, - UtilEnt.getName(data.GetThrower()), GetName()); + UtilEnt.getName(data.getThrower()), GetName()); UtilParticle.PlayParticle(ParticleType.EXPLODE, target.getLocation().add(0, 1, 0), 1f, 1f, 1f, 0, 12, ViewDist.LONG, UtilServer.getPlayers()); } @@ -139,8 +138,8 @@ public class PerkInkBlast extends SmashPerk implements IThrown public void Explode(ProjectileUser data) { - data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.EXPLODE, 0.75f, 1.25f); - data.GetThrown().remove(); + data.getThrown().getWorld().playSound(data.getThrown().getLocation(), Sound.EXPLODE, 0.75f, 1.25f); + data.getThrown().remove(); } @EventHandler diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkIronHook.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkIronHook.java index e629b7d8d..d938dd3d9 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkIronHook.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkIronHook.java @@ -77,13 +77,13 @@ public class PerkIronHook extends Perk implements IThrown public void Collide(LivingEntity target, Block block, ProjectileUser data) { //Remove - double velocity = data.GetThrown().getVelocity().length(); - data.GetThrown().remove(); + double velocity = data.getThrown().getVelocity().length(); + data.getThrown().remove(); - if (!(data.GetThrower() instanceof Player)) + if (!(data.getThrower() instanceof Player)) return; - Player player = (Player)data.GetThrower(); + Player player = (Player)data.getThrower(); if (target == null) return; @@ -109,14 +109,14 @@ public class PerkIronHook extends Perk implements IThrown public void Idle(ProjectileUser data) { //Remove - data.GetThrown().remove(); + data.getThrown().remove(); } @Override public void Expire(ProjectileUser data) { //Remove - data.GetThrown().remove(); + data.getThrown().remove(); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkMadScientist.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkMadScientist.java index 2edeb706a..d94f27e2d 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkMadScientist.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkMadScientist.java @@ -7,22 +7,11 @@ import mineplex.core.common.util.NautHashMap; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilInv; -import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.common.util.UtilServer; -import mineplex.core.disguise.disguises.DisguiseBase; -import mineplex.core.disguise.disguises.DisguiseBlaze; -import mineplex.core.disguise.disguises.DisguiseCow; -import mineplex.core.disguise.disguises.DisguiseInsentient; -import mineplex.core.disguise.disguises.DisguisePig; -import mineplex.core.disguise.disguises.DisguisePigZombie; -import mineplex.core.disguise.disguises.DisguiseSkeleton; -import mineplex.core.disguise.disguises.DisguiseSlime; -import mineplex.core.disguise.disguises.DisguiseSpider; -import mineplex.core.disguise.disguises.DisguiseZombie; import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.projectile.IThrown; import mineplex.core.projectile.ProjectileUser; @@ -36,7 +25,6 @@ import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.block.Block; -import org.bukkit.entity.Cow; import org.bukkit.entity.Creature; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; @@ -185,9 +173,9 @@ public class PerkMadScientist extends Perk implements IThrown if (target != null) { - Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null, + Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.CUSTOM, 1.5D, true, false, false, - UtilEnt.getName(data.GetThrower()), GetName()); + UtilEnt.getName(data.getThrower()), GetName()); } @@ -210,28 +198,28 @@ public class PerkMadScientist extends Perk implements IThrown public void spawnMobs(ProjectileUser data) { - data.GetThrown() + data.getThrown() .getWorld() - .playSound(data.GetThrown().getLocation(), Sound.EXPLODE, 1f, + .playSound(data.getThrown().getLocation(), Sound.EXPLODE, 1f, 1.6f); - UtilParticle.PlayParticle(ParticleType.EXPLODE, data.GetThrown() + UtilParticle.PlayParticle(ParticleType.EXPLODE, data.getThrown() .getLocation(), 0F, 0F, 0F, 1F, 5, ViewDist.SHORT, UtilServer .getPlayers()); - data.GetThrown().remove(); + data.getThrown().remove(); Manager.GetGame().CreatureAllowOverride = true; - Zombie zombie = (Zombie) data.GetThrown().getWorld() - .spawn(data.GetThrown().getLocation(), Zombie.class); + Zombie zombie = (Zombie) data.getThrown().getWorld() + .spawn(data.getThrown().getLocation(), Zombie.class); zombie.setRemoveWhenFarAway(false); zombie.setMaxHealth(10.0D); zombie.setHealth(10.0D); UtilEnt.silence(zombie, true); //Name - zombie.setCustomName(C.cAqua + UtilEnt.getName(data.GetThrower()) + "'s Minion"); + zombie.setCustomName(C.cAqua + UtilEnt.getName(data.getThrower()) + "'s Minion"); zombie.setCustomNameVisible(true); // double r = Math.random(); @@ -261,13 +249,13 @@ public class PerkMadScientist extends Perk implements IThrown // // if (disguise instanceof DisguiseInsentient) // { -// if (((Player) data.GetThrower()).getName().toLowerCase().endsWith("s")) +// if (((Player) data.getThrower()).getName().toLowerCase().endsWith("s")) // { -// ((DisguiseInsentient)disguise).setName(C.cAqua + UtilEnt.getName(data.GetThrower()) + "' Minion"); +// ((DisguiseInsentient)disguise).setName(C.cAqua + UtilEnt.getName(data.getThrower()) + "' Minion"); // } // else // { -// ((DisguiseInsentient)disguise).setName(C.cAqua + UtilEnt.getName(data.GetThrower()) + "' Minion"); +// ((DisguiseInsentient)disguise).setName(C.cAqua + UtilEnt.getName(data.getThrower()) + "' Minion"); // } // // ((DisguiseInsentient)disguise).setCustomNameVisible(true); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkPigBaconBounce.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkPigBaconBounce.java index cff63ed81..b458b763d 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkPigBaconBounce.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkPigBaconBounce.java @@ -104,30 +104,30 @@ public class PerkPigBaconBounce extends SmashPerk implements IThrown @Override public void Collide(LivingEntity target, Block block, ProjectileUser data) { - Rebound(data.GetThrower(), data.GetThrown()); + Rebound(data.getThrower(), data.getThrown()); if (target == null) return; //Damage Event - Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null, + Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.CUSTOM, 4, true, true, false, - UtilEnt.getName(data.GetThrower()), GetName()); + UtilEnt.getName(data.getThrower()), GetName()); - Item item = (Item)data.GetThrown(); + Item item = (Item)data.getThrown(); item.setItemStack(new ItemStack(Material.GRILLED_PORK)); } @Override public void Idle(ProjectileUser data) { - Rebound(data.GetThrower(), data.GetThrown()); + Rebound(data.getThrower(), data.getThrown()); } @Override public void Expire(ProjectileUser data) { - Rebound(data.GetThrower(), data.GetThrown()); + Rebound(data.getThrower(), data.getThrown()); } public void Rebound(LivingEntity player, Entity ent) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkRevealer.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkRevealer.java index 022e13315..37dabb0f8 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkRevealer.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkRevealer.java @@ -147,22 +147,22 @@ public class PerkRevealer extends Perk implements IThrown { // Workaround to make firework effect always visible for (int i = 0; i < 3; i++) - UtilFirework.playFirework(data.GetThrown().getLocation(), REVEALER_FIREWORK_EFFECT); + UtilFirework.playFirework(data.getThrown().getLocation(), REVEALER_FIREWORK_EFFECT); - data.GetThrown().getLocation().getWorld().playSound(data.GetThrown().getLocation(), Sound.ZOMBIE_UNFECT, 2f, 0.5f); + data.getThrown().getLocation().getWorld().playSound(data.getThrown().getLocation(), Sound.ZOMBIE_UNFECT, 2f, 0.5f); for (Player player : Manager.GetGame().GetPlayers(true)) { - if (player == data.GetThrower()) + if (player == data.getThrower()) continue; - if (player.getLocation().getWorld() == data.GetThrown().getWorld() && player.getLocation().distanceSquared(data.GetThrown().getLocation()) <= 12 * 12) + if (player.getLocation().getWorld() == data.getThrown().getWorld() && player.getLocation().distanceSquared(data.getThrown().getLocation()) <= 12 * 12) { RevealedPlayerInfo info = getRevealedPlayers().get(player); if (info == null) { - Bukkit.getPluginManager().callEvent(new PlayerRevealEvent(player, data.GetThrower())); + Bukkit.getPluginManager().callEvent(new PlayerRevealEvent(player, data.getThrower())); info = new RevealedPlayerInfo(Manager.GetDisguise().getDisguise(player)); getRevealedPlayers().put(player, info); @@ -175,7 +175,7 @@ public class PerkRevealer extends Perk implements IThrown } } - data.GetThrown().remove(); + data.getThrown().remove(); } public Map getRevealedPlayers() diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSkeletons.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSkeletons.java index 3533cc8be..6cff0cdb4 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSkeletons.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSkeletons.java @@ -1,10 +1,15 @@ package nautilus.game.arcade.kit.perks; import mineplex.core.common.util.*; +import mineplex.core.disguise.disguises.DisguiseZombie; +import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.gadgets.gamemodifiers.kits.KitModifier; +import mineplex.core.gadget.gadgets.gamemodifiers.kits.KitModifierType; import mineplex.core.updater.*; import mineplex.core.updater.event.*; import mineplex.minecraft.game.core.combat.event.*; import mineplex.minecraft.game.core.damage.*; +import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.kit.*; import net.minecraft.server.v1_8_R3.*; @@ -52,18 +57,20 @@ public class PerkSkeletons extends Perk } } + private ArcadeManager _manager; + private HashMap> _minions = new HashMap>(); private boolean _name; private int _maxDist = 8; - public PerkSkeletons(boolean name) + public PerkSkeletons(ArcadeManager manager, boolean name) { super("Skeleton Minons", new String[] { C.cGray + "Killing an opponent summons a skeletal minion." }); - + _manager = manager; _name = name; } @@ -112,6 +119,29 @@ public class PerkSkeletons extends Perk skel.getEquipment().setLeggingsDropChance(1f); skel.getEquipment().setBootsDropChance(1f); + KitModifier kitModifier = getSkeletonType(killer); + if (kitModifier != null) + { + switch (kitModifier) + { + case Survival_Games_Necromancer_Wither_Skeleton: + skel.setSkeletonType(Skeleton.SkeletonType.WITHER); + break; + case Survival_Games_Necromancer_Zombie: + skel.setSkeletonType(Skeleton.SkeletonType.NORMAL); + DisguiseZombie disguiseZombie = new DisguiseZombie(skel); + _manager.getCosmeticManager().getGadgetManager().getDisguiseManager().disguise(disguiseZombie); + break; + default: + skel.setSkeletonType(Skeleton.SkeletonType.NORMAL); + break; + } + } + else + { + skel.setSkeletonType(Skeleton.SkeletonType.NORMAL); + } + if (_name) { skel.setCustomName("Skeletal " + UtilEnt.getName(event.GetEvent().getEntity())); @@ -119,7 +149,7 @@ public class PerkSkeletons extends Perk } if (!_minions.containsKey(killer)) - _minions.put(killer, new ArrayList()); + _minions.put(killer, new ArrayList<>()); _minions.get(killer).add(skel); @@ -292,4 +322,10 @@ public class PerkSkeletons extends Perk { return _minions.get(player); } + + private KitModifier getSkeletonType(Player player) + { + GadgetManager gadgetManager = _manager.getCosmeticManager().getGadgetManager(); + return gadgetManager.getActiveKitModifier(KitModifierType.SurvivalGames_NecromancerKit, player); + } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSlimeRocket.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSlimeRocket.java index 1b16508b9..4a433a9d2 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSlimeRocket.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSlimeRocket.java @@ -220,15 +220,15 @@ public class PerkSlimeRocket extends SmashPerk implements IThrown if (target == null) return; - if (!(data.GetThrown() instanceof Slime)) + if (!(data.getThrown() instanceof Slime)) return; - Slime slime = (Slime)data.GetThrown(); + Slime slime = (Slime)data.getThrown(); //Damage Event - Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null, + Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.PROJECTILE, 3 + slime.getSize() * 3, true, true, false, - UtilEnt.getName(data.GetThrower()), GetName()); + UtilEnt.getName(data.getThrower()), GetName()); } @EventHandler diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSquidRifle.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSquidRifle.java index 7beb2494c..0157bf271 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSquidRifle.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSquidRifle.java @@ -136,9 +136,9 @@ public class PerkSquidRifle extends Perk implements IThrown return; //Damage Event - Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null, + Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.PROJECTILE, 50, false, true, false, - UtilEnt.getName(data.GetThrower()), GetName()); + UtilEnt.getName(data.getThrower()), GetName()); } @Override @@ -155,13 +155,13 @@ public class PerkSquidRifle extends Perk implements IThrown public void Explode(ProjectileUser data) { - if (!(data.GetThrown() instanceof Firework)) + if (!(data.getThrown() instanceof Firework)) { - data.GetThrown().remove(); + data.getThrown().remove(); return; } - Firework fw = (Firework)data.GetThrown(); + Firework fw = (Firework)data.getThrown(); try { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSquidShotgun.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSquidShotgun.java index cb51926b9..797468967 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSquidShotgun.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSquidShotgun.java @@ -145,14 +145,14 @@ public class PerkSquidShotgun extends Perk implements IThrown return; //Damage Event - Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null, + Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.PROJECTILE, 12, false, true, false, - UtilEnt.getName(data.GetThrower()), GetName()); + UtilEnt.getName(data.getThrower()), GetName()); //Recharge - if (data.GetThrower() instanceof Player) + if (data.getThrower() instanceof Player) { - Player player = (Player)data.GetThrower(); + Player player = (Player)data.getThrower(); Recharge.Instance.recharge(player, GetName()); player.playSound(player.getLocation(), Sound.NOTE_STICKS, 3f, 1f); } @@ -172,13 +172,13 @@ public class PerkSquidShotgun extends Perk implements IThrown public void Explode(ProjectileUser data) { - if (!(data.GetThrown() instanceof Firework)) + if (!(data.getThrown() instanceof Firework)) { - data.GetThrown().remove(); + data.getThrown().remove(); return; } - Firework fw = (Firework)data.GetThrown(); + Firework fw = (Firework)data.getThrown(); try { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSquidSniper.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSquidSniper.java index 687869ecc..96b38e418 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSquidSniper.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSquidSniper.java @@ -136,14 +136,14 @@ public class PerkSquidSniper extends Perk implements IThrown return; //Damage Event - Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null, + Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.PROJECTILE, 50, false, true, false, - UtilEnt.getName(data.GetThrower()), GetName()); + UtilEnt.getName(data.getThrower()), GetName()); //Recharge - if (data.GetThrower() instanceof Player) + if (data.getThrower() instanceof Player) { - Player player = (Player)data.GetThrower(); + Player player = (Player)data.getThrower(); Recharge.Instance.recharge(player, GetName()); player.playSound(player.getLocation(), Sound.NOTE_STICKS, 3f, 1f); } @@ -163,13 +163,13 @@ public class PerkSquidSniper extends Perk implements IThrown public void Explode(ProjectileUser data) { - if (!(data.GetThrown() instanceof Firework)) + if (!(data.getThrown() instanceof Firework)) { - data.GetThrown().remove(); + data.getThrown().remove(); return; } - Firework fw = (Firework)data.GetThrown(); + Firework fw = (Firework)data.getThrown(); try { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkThrower.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkThrower.java index f46f3433e..acce5d08c 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkThrower.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkThrower.java @@ -97,21 +97,21 @@ public class PerkThrower extends Perk implements IThrown } //Damage Event - Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null, + Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.CUSTOM, 6, false, true, false, - UtilEnt.getName(data.GetThrower()), GetName()); + UtilEnt.getName(data.getThrower()), GetName()); //Bounce - Vector dir = UtilAlg.getTrajectory(data.GetThrown(), target); + Vector dir = UtilAlg.getTrajectory(data.getThrown(), target); if (dir.getY() < 0) dir.setY(0); UtilAction.velocity(target, dir, 1.2, false, 0, 0.4, 1, true); - dir = UtilAlg.getTrajectory(target, data.GetThrown()); + dir = UtilAlg.getTrajectory(target, data.getThrown()); if (dir.getY() < 0) dir.setY(0); - UtilAction.velocity(data.GetThrown(), dir, 0.2, false, 0, 0.2, 1, true); + UtilAction.velocity(data.getThrown(), dir, 0.2, false, 0, 0.2, 1, true); //Effect - data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.SHEEP_IDLE, 3f, 5f); + data.getThrown().getWorld().playSound(data.getThrown().getLocation(), Sound.SHEEP_IDLE, 3f, 5f); } @Override diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWeb.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWeb.java index 2e40fe70d..dcaa8df8d 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWeb.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWeb.java @@ -131,8 +131,8 @@ public class PerkWeb extends Perk implements IThrown public void Web(ProjectileUser data) { - Location loc = data.GetThrown().getLocation(); - data.GetThrown().remove(); + Location loc = data.getThrown().getLocation(); + data.getThrown().remove(); Manager.GetBlockRestore().add(loc.getBlock(), 30, (byte) 0, 4000); } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWebShot.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWebShot.java index cbe999d59..7103f5ca7 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWebShot.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWebShot.java @@ -91,14 +91,14 @@ public class PerkWebShot extends SmashPerk implements IThrown { if (target != null) { - data.GetThrown().remove(); + data.getThrown().remove(); Manager.GetBlockRestore().add(target.getLocation().getBlock(), 30, (byte) 0, 3000); //Damage Event - Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null, + Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.PROJECTILE, 6, false, false, false, - UtilEnt.getName(data.GetThrower()), GetName()); + UtilEnt.getName(data.getThrower()), GetName()); UtilAction.zeroVelocity(target); @@ -122,10 +122,10 @@ public class PerkWebShot extends SmashPerk implements IThrown public void Web(ProjectileUser data) { - Location loc = data.GetThrown().getLocation(); - data.GetThrown().remove(); + Location loc = data.getThrown().getLocation(); + data.getThrown().remove(); - if (data.GetThrown().getTicksLived() > 3) + if (data.getThrown().getTicksLived() > 3) Manager.GetBlockRestore().add(loc.getBlock(), 30, (byte) 0, 2000); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWitherWeb.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWitherWeb.java index 9e270d6f5..d643727a3 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWitherWeb.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWitherWeb.java @@ -98,10 +98,10 @@ public class PerkWitherWeb extends Perk implements IThrown public void Web(ProjectileUser data) { - Location loc = data.GetThrown().getLocation(); - data.GetThrown().remove(); + Location loc = data.getThrown().getLocation(); + data.getThrown().remove(); - if (data.GetThrown().getTicksLived() > 3) + if (data.getThrown().getTicksLived() > 3) Manager.GetBlockRestore().add(loc.getBlock(), 30, (byte) 0, 3000); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWolfPet.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWolfPet.java index 1c0dda66b..c9cbb4f20 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWolfPet.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWolfPet.java @@ -4,18 +4,19 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; +import mineplex.core.disguise.disguises.*; +import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.gadgets.gamemodifiers.kits.KitModifier; +import mineplex.core.gadget.gadgets.gamemodifiers.kits.KitModifierType; +import nautilus.game.arcade.ArcadeManager; import org.bukkit.DyeColor; import org.bukkit.EntityEffect; -import org.bukkit.GameMode; import org.bukkit.Location; import org.bukkit.Sound; import org.bukkit.craftbukkit.v1_8_R3.entity.CraftCreature; import org.bukkit.craftbukkit.v1_8_R3.entity.CraftLivingEntity; import org.bukkit.craftbukkit.v1_8_R3.entity.CraftWolf; -import org.bukkit.entity.Entity; -import org.bukkit.entity.LivingEntity; -import org.bukkit.entity.Player; -import org.bukkit.entity.Wolf; +import org.bukkit.entity.*; import org.bukkit.event.EventHandler; import org.bukkit.event.block.Action; import org.bukkit.event.entity.EntityTargetEvent; @@ -30,28 +31,28 @@ import mineplex.core.updater.UpdateType; import mineplex.minecraft.game.core.damage.CustomDamageEvent; import nautilus.game.arcade.kit.Perk; import net.minecraft.server.v1_8_R3.EntityCreature; -import net.minecraft.server.v1_8_R3.Navigation; import net.minecraft.server.v1_8_R3.NavigationAbstract; public class PerkWolfPet extends Perk { - private HashMap> _wolfMap = new HashMap>(); + private HashMap> _petMap = new HashMap<>(); - private HashMap _tackle = new HashMap(); + private HashMap _tackle = new HashMap<>(); + private ArcadeManager _manager; private int _spawnRate; private int _max; private boolean _baby; private boolean _name; - public PerkWolfPet(int spawnRate, int max, boolean baby, boolean name) + public PerkWolfPet(ArcadeManager manager, int spawnRate, int max, boolean baby, boolean name) { super("Wolf Master", new String[] { C.cGray + "Spawn 1 Wolf every " + spawnRate + " seconds. Maximum of " + max + ".", C.cYellow + "Right-Click" + C.cGray + " with Sword/Axe to use " + C.cGreen + "Wolf Tackle", }); - + _manager = manager; _spawnRate = spawnRate; _max = max; _baby = baby; @@ -65,7 +66,7 @@ public class PerkWolfPet extends Perk } @EventHandler - public void CubSpawn(UpdateEvent event) + public void cubSpawn(UpdateEvent event) { if (event.getType() != UpdateType.FAST) return; @@ -81,16 +82,14 @@ public class PerkWolfPet extends Perk if (!Recharge.Instance.use(cur, GetName(), _spawnRate*1000, false, false)) continue; - if (!_wolfMap.containsKey(cur)) - _wolfMap.put(cur, new ArrayList()); + if (!_petMap.containsKey(cur)) + _petMap.put(cur, new ArrayList<>()); - if (_wolfMap.get(cur).size() >= _max) + if (_petMap.get(cur).size() >= _max) continue; Manager.GetGame().CreatureAllowOverride = true; Wolf wolf = cur.getWorld().spawn(cur.getLocation(), Wolf.class); - Manager.GetGame().CreatureAllowOverride = false; - SpigotUtil.setOldOwner_RemoveMeWhenSpigotFixesThis(wolf, cur); wolf.setOwner(cur); wolf.setCollarColor(DyeColor.GREEN); @@ -106,33 +105,33 @@ public class PerkWolfPet extends Perk { wolf.setCustomName(cur.getName() + "'s Wolf"); } - - - _wolfMap.get(cur).add(wolf); - + _petMap.get(cur).add(wolf); + Manager.GetGame().CreatureAllowOverride = false; cur.playSound(cur.getLocation(), Sound.WOLF_HOWL, 1f, 1f); + disguise(wolf, cur); } } @EventHandler - public void CubTargetCancel(EntityTargetEvent event) + public void cubTargetCancel(EntityTargetEvent event) { - if (!_wolfMap.containsKey(event.getTarget())) + if (!_petMap.containsKey(event.getTarget())) return; - if (_wolfMap.get(event.getTarget()).contains(event.getEntity())) + if (_petMap.get(event.getTarget()).contains(event.getEntity())) event.setCancelled(true); } + // Note: Why are there 4 different update event handlers? @EventHandler - public void CubUpdate(UpdateEvent event) + public void cubUpdate(UpdateEvent event) { if (event.getType() != UpdateType.FAST) return; - for (Player player : _wolfMap.keySet()) + for (Player player : _petMap.keySet()) { - Iterator wolfIterator = _wolfMap.get(player).iterator(); + Iterator wolfIterator = _petMap.get(player).iterator(); while (wolfIterator.hasNext()) { @@ -149,7 +148,7 @@ public class PerkWolfPet extends Perk if (player.isSneaking()) { - ((CraftWolf)wolf).getHandle().setGoalTarget(null); + ((CraftWolf) wolf).getHandle().setGoalTarget(null); } //Return to Owner @@ -167,7 +166,7 @@ public class PerkWolfPet extends Perk speed = 1.4f; //Move - EntityCreature ec = ((CraftCreature)wolf).getHandle(); + EntityCreature ec = ((CraftCreature) wolf).getHandle(); NavigationAbstract nav = ec.getNavigation(); nav.a(target.getX(), target.getY(), target.getZ(), speed); @@ -178,7 +177,7 @@ public class PerkWolfPet extends Perk } @EventHandler - public void CubStrikeTrigger(PlayerInteractEvent event) + public void cubStrikeTrigger(PlayerInteractEvent event) { if (event.isCancelled()) return; @@ -200,7 +199,7 @@ public class PerkWolfPet extends Perk if (!Kit.HasKit(player)) return; - if (!_wolfMap.containsKey(player) || _wolfMap.get(player).isEmpty()) + if (!_petMap.containsKey(player) || _petMap.get(player).isEmpty()) { UtilPlayer.message(player, F.main("Game", "You have no Wolf Cubs.")); return; @@ -209,7 +208,7 @@ public class PerkWolfPet extends Perk if (!Recharge.Instance.use(player, "Cub Strike", 4000, true, true)) return; - Wolf wolf = _wolfMap.get(player).get(UtilMath.r(_wolfMap.get(player).size())); + Wolf wolf = _petMap.get(player).get(UtilMath.r(_petMap.get(player).size())); UtilAction.velocity(wolf, player.getLocation().getDirection(), 1.4, false, 0, 0.2, 1.2, true); @@ -225,7 +224,7 @@ public class PerkWolfPet extends Perk } @EventHandler - public void CubStrikeEnd(UpdateEvent event) + public void cubStrikeEnd(UpdateEvent event) { if (event.getType() != UpdateType.TICK) return; @@ -244,7 +243,7 @@ public class PerkWolfPet extends Perk if (other.equals(wolf.getOwner())) continue; - CubStrikeHit((Player)wolf.getOwner(), other, wolf); + cubStrikeHit((Player)wolf.getOwner(), other, wolf); wolfIterator.remove(); return; } @@ -259,11 +258,11 @@ public class PerkWolfPet extends Perk } } - public void CubStrikeHit(Player damager, LivingEntity damagee, Wolf wolf) + public void cubStrikeHit(Player damager, LivingEntity damagee, Wolf wolf) { //Damage Event ((CraftWolf)wolf).getHandle().setGoalTarget(((CraftLivingEntity)damagee).getHandle(), EntityTargetEvent.TargetReason.CUSTOM, false); - + //Sound damagee.getWorld().playSound(damagee.getLocation(), Sound.WOLF_BARK, 1.5f, 1.5f); @@ -276,12 +275,12 @@ public class PerkWolfPet extends Perk } @EventHandler - public void CubHeal(UpdateEvent event) + public void cubHeal(UpdateEvent event) { if (event.getType() != UpdateType.SEC) return; - for (ArrayList wolves : _wolfMap.values()) + for (ArrayList wolves : _petMap.values()) { for (Wolf wolf : wolves) { @@ -292,9 +291,9 @@ public class PerkWolfPet extends Perk } @EventHandler - public void PlayerDeath(PlayerDeathEvent event) + public void playerDeath(PlayerDeathEvent event) { - ArrayList wolves = _wolfMap.remove(event.getEntity()); + ArrayList wolves = _petMap.remove(event.getEntity()); if (wolves == null) return; @@ -306,9 +305,9 @@ public class PerkWolfPet extends Perk } @EventHandler - public void PlayerQuit(PlayerQuitEvent event) + public void playerQuit(PlayerQuitEvent event) { - ArrayList wolves = _wolfMap.remove(event.getPlayer()); + ArrayList wolves = _petMap.remove(event.getPlayer()); if (wolves == null) return; @@ -319,9 +318,9 @@ public class PerkWolfPet extends Perk wolves.clear(); } - public boolean IsMinion(Entity ent) + public boolean isMinion(Entity ent) { - for (ArrayList minions : _wolfMap.values()) + for (ArrayList minions : _petMap.values()) { for (Wolf minion : minions) { @@ -336,12 +335,12 @@ public class PerkWolfPet extends Perk } @EventHandler - public void Damage(CustomDamageEvent event) + public void damage(CustomDamageEvent event) { if (event.GetDamagerEntity(true) == null) return; - if (!IsMinion(event.GetDamagerEntity(true))) + if (!isMinion(event.GetDamagerEntity(true))) return; double damage = 3; @@ -349,4 +348,47 @@ public class PerkWolfPet extends Perk event.AddMod("Wolf Minion", "Negate", -event.GetDamageInitial(), false); event.AddMod("Wolf Minion", "Damage", damage, false); } + + private void disguise(Entity wolf, Player player) + { + EntityType entityType = getDisguiseType(player); + if (entityType != null) + { + if (entityType.equals(EntityType.GUARDIAN)) + { + DisguiseGuardian disguiseGuardian = new DisguiseGuardian(wolf); + _manager.getCosmeticManager().getGadgetManager().getDisguiseManager().disguise(disguiseGuardian); + return; + } + else if (entityType.equals(EntityType.SQUID)) + { + DisguiseSquid disguiseSquid = new DisguiseSquid(wolf); + _manager.getCosmeticManager().getGadgetManager().getDisguiseManager().disguise(disguiseSquid); + return; + } + DisguiseAnimalBase disguiseAnimal = new DisguiseAnimalBase(entityType, wolf); + _manager.getCosmeticManager().getGadgetManager().getDisguiseManager().disguise(disguiseAnimal); + } + } + + private EntityType getDisguiseType(Player player) + { + GadgetManager gadgetManager = _manager.getCosmeticManager().getGadgetManager(); + KitModifier kitModifier = gadgetManager.getActiveKitModifier(KitModifierType.SurvivalGames_BeastmasterKit, player); + if (kitModifier != null) + { + switch (kitModifier) + { + case Survival_Games_Beastmaster_Chicken: + return EntityType.CHICKEN; + case Survival_Games_Beastmaster_Mini_Guardian: + return EntityType.GUARDIAN; + case Survival_Games_Beastmaster_Pig: + return EntityType.PIG; + case Survival_Games_Beastmaster_Squid: + return EntityType.SQUID; + } + } + return null; + } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWoolBomb.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWoolBomb.java index 5f692fb5d..436db672e 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWoolBomb.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWoolBomb.java @@ -241,27 +241,27 @@ public class PerkWoolBomb extends Perk implements IThrown @Override public void Collide(LivingEntity target, Block block, ProjectileUser data) { - solidify(data.GetThrower(), false); + solidify(data.getThrower(), false); if (target == null) return; //Damage Event - Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null, + Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.PROJECTILE, 4, true, true, false, - UtilEnt.getName(data.GetThrower()), GetName()); + UtilEnt.getName(data.getThrower()), GetName()); } @Override public void Idle(ProjectileUser data) { - solidify(data.GetThrower(), false); + solidify(data.getThrower(), false); } @Override public void Expire(ProjectileUser data) { - solidify(data.GetThrower(), false); + solidify(data.getThrower(), false); } @EventHandler diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkZombieBile.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkZombieBile.java index 116cd0add..adb0f1455 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkZombieBile.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkZombieBile.java @@ -133,7 +133,7 @@ public class PerkZombieBile extends SmashPerk implements IThrown @Override public void Collide(LivingEntity target, Block block, ProjectileUser data) { - data.GetThrown().remove(); + data.getThrown().remove(); if (target == null) return; @@ -143,23 +143,23 @@ public class PerkZombieBile extends SmashPerk implements IThrown return; //Damage Event - Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null, + Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.CUSTOM, 3, true, false, false, - UtilEnt.getName(data.GetThrower()), GetName()); + UtilEnt.getName(data.getThrower()), GetName()); - data.GetThrown().remove(); + data.getThrown().remove(); } @Override public void Idle(ProjectileUser data) { - data.GetThrown().remove(); + data.getThrown().remove(); } @Override public void Expire(ProjectileUser data) { - data.GetThrown().remove(); + data.getThrown().remove(); } @EventHandler diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/chat/GameChatManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/chat/GameChatManager.java index 347730a4d..2bb9542fb 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/chat/GameChatManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/chat/GameChatManager.java @@ -310,7 +310,7 @@ public class GameChatManager implements Listener { if (!_manager.GetGame().GetStats().containsKey(player)) { - temp.add(new AbstractMap.SimpleEntry(C.cGray + "Retrieving stats..", "")); + temp.add(new AbstractMap.SimpleEntry(C.cGray + "Retrieving stats...", "")); break; }