diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/shape/ShapeWings.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/shape/ShapeWings.java index 6d5ca87be..439bf4958 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/shape/ShapeWings.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/shape/ShapeWings.java @@ -1,14 +1,18 @@ package mineplex.core.common.shape; +import java.awt.Color; + import org.bukkit.Location; import org.bukkit.util.Vector; import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; +import mineplex.core.common.util.particles.ColoredParticle; +import mineplex.core.common.util.particles.DustSpellColor; /** - * Some simple wing shapes implementing {@link ICosmeticShape} storing additional particle information + * Some simple wing shapes implementing {@link CosmeticShape} storing additional particle information */ public class ShapeWings extends ShapeGrid implements CosmeticShape @@ -51,20 +55,60 @@ public class ShapeWings extends ShapeGrid implements CosmeticShape public static final String[] BUTTERFLY_WING_PATTERN = new String[] { - "0$$0000000000000000$$0", - "$##$00000000000000$##$", - "0$##$000000000000$##$0", - "00$##$0000000000$##$00", - "00$###$00000000$###$00", - "000$####$0000$####$000", - "000$######$$#####$0000", - "0000$############$0000", - "00000$##########$00000", - "00000$##########$00000", - "00000$####$$$###$00000", - "00000$###$000$###$0000", - "00000$##$00000$##$0000", - "000000$000000000$00000" + "0$$000000000000000$$0", + "$##$0000000000000$##$", + "0$##$00000000000$##$0", + "00$##$000000000$##$00", + "00$###$0000000$###$00", + "000$###$$000$$###$000", + "0000$####$$$####$0000", + "0000$###########$0000", + "00000$#########$00000", + "00000$#########$00000", + "00000$###$$$###$00000", + "0000$###$000$###$0000", + "0000$##$00000$##$0000", + "00000$$0000000$$00000" + }; + + public static final String[] SMALL_BUTTERFLY_WING_PATTERN = new String[] + { + "0$$00000000$$0", + "$##$000000$##$", + "0$##$0000$##$0", + "00$##$$$$##$00", + "000$######$000", + "000$######$000", + "00$###$$###$00", + "000$#$00$#$000", + "0000$0000$0000" + }; + + public static final String[] HEART_WING_PATTERN = new String[] + { + "00$00000000000000000$00", + "0$%$000000000000000$%$0", + "$%%%$$00$$000$$00$$%%%$", + "$%%%%%$$##$0$##$$%%%%%$", + "$%%%%%$####$####$%%%%%$", + "0$%%%%$#########$%%%%$0", + "00$%%%$#########$%%%$00", + "000$%%$$#######$$%%$000", + "0000$$00$#####$00$$0000", + "000000000$###$000000000", + "0000000000$#$0000000000", + "00000000000$00000000000" + }; + + public static final String[] SMALL_HEART_WING_PATTERN = new String[] + { + "0$000000000$0", + "$%$0$$0$$0$%$", + "$%%$##$##$%%$", + "0$%$00000$%$0", + "00$0$###$0$00", + "00000$#$00000", + "000000$000000" }; @@ -163,17 +207,38 @@ public class ShapeWings extends ShapeGrid implements CosmeticShape rotateOnXAxis(xRotation); } + public ShapeWings(String particle, Vector offsetData, float speed, int count, char c, double xRotation, String... pattern) + { + super(0.15, c, pattern); + _particle = particle; + _offsetData = offsetData; + _speed = speed; + _count = count; + rotateOnXAxis(xRotation); + } + @Override public void display(Location loc) { Shape clone = clone(); clone.rotateOnYAxis(Math.toRadians(loc.getYaw())); - for(Vector v : clone._points) + for (Vector v : clone.getPoints()) { Location ploc = loc.clone().add(v); displayParticle(ploc); } } + + public void displayColored(Location loc, Color color) + { + Shape clone = clone(); + clone.rotateOnYAxis(Math.toRadians(loc.getYaw())); + for (Vector v : clone.getPoints()) + { + Location ploc = loc.clone().add(v); + displayColoredParticle(ploc, color); + } + } /** * Display a single particle of the type provided to this shape at the given location. @@ -183,4 +248,10 @@ public class ShapeWings extends ShapeGrid implements CosmeticShape UtilParticle.PlayParticleToAll(_particle, loc, _offsetData, _speed, _count, ViewDist.NORMAL); } + public void displayColoredParticle(Location loc, Color color) + { + ColoredParticle coloredParticle = new ColoredParticle(ParticleType.RED_DUST, new DustSpellColor(color), loc); + coloredParticle.display(ViewDist.NORMAL); + } + } diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/skin/SkinData.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/skin/SkinData.java index 1cabb2dd1..ff803a28b 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/skin/SkinData.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/skin/SkinData.java @@ -63,7 +63,8 @@ public class SkinData public final static SkinData WITCH = new SkinData("eyJ0aW1lc3RhbXAiOjE0NzM5OTEyMTE1NDQsInByb2ZpbGVJZCI6IjlmY2FlZDhiMTRiNTRmN2ZhNjRjYjYwNDBlNzA1MjcyIiwicHJvZmlsZU5hbWUiOiJMQ2FzdHIxIiwic2lnbmF0dXJlUmVxdWlyZWQiOnRydWUsInRleHR1cmVzIjp7IlNLSU4iOnsidXJsIjoiaHR0cDovL3RleHR1cmVzLm1pbmVjcmFmdC5uZXQvdGV4dHVyZS81NDg1ZDZlMTBhNmNmMmY3Mzg2NmZhMGRiNjEzOWQ5NWViZDM0ZGZiMGY0YzAxMmRkM2YzYWYxMWQ5ZjQxYyJ9fX0=", "cojkGLflVWxwnhDXmHMke7crkeA78iUYOWY7H3YvMJFD+VZi9E7vUahLTTx5ELH+PvcaHJerSDmuV+Nasc3K2n6zlXXb0B7RB/ose/kdPxHAIJee7IbZX0iFNDn6irUSOS4wOYF/BwaqG3HmpoSxV52SGMs6kqTer2Rjg3X+XwYFFiDHAR/gwhfXLzrM1iBc171vgu6T+kx65iBHa/YB/V/mj8FSxwM0f5IsLpgAEdxDL9PvEKQWgWeZ1CAqEXlGnjPkd9oGzW0TgDz2MksBbYZ2kmn/S53kK9vCrVB7egZPS4VBtKpq1P7Jeu8rtgjnAKVFQJZ2lMHnVRuvGTd8JKoPHarUPpU2LURUMaCtHzSv9v/4gjkafnDhqxG4TTcr5hxFV+ho72HQchoeaUXzIO+Yo71zrVqkrS0hw6OtgMIBlvaGaEUsFvGiCZePBEiHojO43AKqJcJAVeT2RAzHcAaBAO79ACGjNKw/oj02rOurLha9i+99bKui96Eg7SS/nPchbmu5YQ9nSpkW+JeYXnBzGGzNG4y02VWgz15L718+8161zXobhuK07qlY9i1nipFbEJedqG0cfS+AUzauETFvS9nMtxhtftYPCIxm40GQj6e77asNCAEElGssaUGKO3bjm348+oF9tR/eBOYWJQ8kL46IQLDRoop7UhG4ewY="); public final static SkinData TURKEY = new SkinData("eyJ0aW1lc3RhbXAiOjE0NzU3NzM2MTc5MDQsInByb2ZpbGVJZCI6IjlmY2FlZDhiMTRiNTRmN2ZhNjRjYjYwNDBlNzA1MjcyIiwicHJvZmlsZU5hbWUiOiJMQ2FzdHIxIiwic2lnbmF0dXJlUmVxdWlyZWQiOnRydWUsInRleHR1cmVzIjp7IlNLSU4iOnsidXJsIjoiaHR0cDovL3RleHR1cmVzLm1pbmVjcmFmdC5uZXQvdGV4dHVyZS8xYzdmYjczMTRkNmY1ZTMzNmVjN2ViNTI1ZGM0ODMzOWNhMjI4ZDk3ODU1MDM3ZDZhNDIwOGZjNzYwNDc1NiJ9fX0=", "eZWi1LOD8ke7MCUAfhspBCnyfCoGM8suFLKtbW6b27CURoRBG3eKIfwLYYeMp3ObjoZ8gCB90s28Qyw5XMzwvvowy9W/b5cYC0OzQ8+GR7tDZoWc28tGqGBM8cmDJIFQgZdceBIIr2lXeAvEJfLbyrus46hPjk8YTiQW2DsBq88BhKIy6Igb1rGqJ1goVERF07b6+/yMdLKCaT8OZFzKLXfo5rY5gr6HLnvsQiNL9aTrl74agXn1GUcP+QVNe7/c9lYmv5vLCBst1YiIPq27NZASZ++Fwyv6+PRlaFZZYtMHVd4UZeYPl7ak1Cdi/1sUcRpkBbJM8AHIrqq0iuXxrLbc6ldQ2cYQKHg9ljIpW/EZanuf6Wgm/LK1JnxXne9GUb/xPzB1EnZ95i8/u9WJa+NixEcfc3pAzDPYncIR8lishFwyBRta6BCG76U3UY2lQr3YD/48AJ49r7+WVU0gOP/h2SDSdAZHEdvkpVJ0w/xA+SevJ7Y7xA5EJ655YMQ0F8f3WUFTf1pFklE5E+fwkMVCWOPw7UMy558IcRSpdWAPPyf8sc7CpDqRk37/vXWRDa+7YBfgskK6B2eXowrzThUOBx+AmDTF3Rv8ZSr1Un0FWGi+GQ5ny7W9dJBMomzyMUbzz9stsCml5XB+6xLP2MD+9lO1bHipKS6qkhtZChE="); public final static SkinData GINGERBREAD = new SkinData("eyJ0aW1lc3RhbXAiOjE0ODAxOTk5MjM0NTUsInByb2ZpbGVJZCI6IjRjOGQ1NjllZWZlMTRkOGE4YzJmMmM4ODA3ODA3ODRmIiwicHJvZmlsZU5hbWUiOiJHaW5nZXJicmVhZE1hbiIsInNpZ25hdHVyZVJlcXVpcmVkIjp0cnVlLCJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMzAyM2IxZGQ5MWQyYjM2Y2FkZTU2NjVjM2Y3ODk3ZmNiOGRlMWFlNjE5YTRlOTYxODU2MzdiMTliZGNmZjQ3In19fQ==", "lND5lQCzd5DKdn+ps82zn55hrSDr12bBLFoSbxetOj7MaYAuHCkJPQQOXdcMh3TLLSgxmQzEWkIHSUo760/2Qfd2uDDOTVfZZqiFjiOwDQ7YQjkokqNaC3U9gEq+LBJ+IgEkwaCsluXYMIK0Wvqx1DFa82pg8bSYGczJfTw/1kQsUUTpmao6ChZw3yrHTPow38onD95f9i6yVcnhSpPfM/JTQuL4N6Jdcql6VRJNSvCHJvEgh6R2p0w7DJhEGIzkFaF3lPdBqw+Mm97fBPvznscd4s6gpH07gUl/T+vlyHyRBLm85Pgm70r4MQ+c/nGOQOXzFMNpO8RIot/uhd7t3bvSi6yFzZQm7P9QLCLm/0C84x0sCugjeN/hVA347FWnuRPcya5xPzlpTWAW7pCjheAz0mvnPUMYT6Wp4CJx6bPdePnaiLFSeK8EyQIU9IUQJgXqMA3cOwqMBdh/0r71fTInPdgXsVxabmGbCgIuK3A2hSgxpcZv9412T0NIJYSTi0s2B3dyAaZJrdF5wa1hIr8au63SWFJww3GEEOF5YObEyVvKj2yS40iaHaRrfn1DeALT0eD0oN1zzK66FKbFuDmZmm4Thel9gKt+QcnR2uHlFLEBUogpIXyeC8zca7SOppANloOpO4mBbf22dXBJogenVd425JWaXOHJ6NVqIBw="); - + public final static SkinData LOVE_DOCTOR = new SkinData("eyJ0aW1lc3RhbXAiOjE0ODQ0MzM1MjQxMjAsInByb2ZpbGVJZCI6IjlmY2FlZDhiMTRiNTRmN2ZhNjRjYjYwNDBlNzA1MjcyIiwicHJvZmlsZU5hbWUiOiJMQ2FzdHIxIiwic2lnbmF0dXJlUmVxdWlyZWQiOnRydWUsInRleHR1cmVzIjp7IlNLSU4iOnsidXJsIjoiaHR0cDovL3RleHR1cmVzLm1pbmVjcmFmdC5uZXQvdGV4dHVyZS9iY2RiZTM2OTM1NGZjMzUxY2RhNGRmY2Y2OWM0MzY3ODcwYjI4ZWE3NDUzYWVjM2IzMjgyM2YyMWMzNTJlNTUifX19", "KD0NsKFlS+9/JpPQdT0Lq2jo942WeHpFevJPR3T9JO/5NVmNprupsWuTgepw14iHoax8/xyP8S4XksYq8hJ30e+gRKXVReqtq4l8JetXJILI7JTL6EHj/Flg4t0O6ASIm3Hr+w86IKrPb0NwHTjHJHvbf0r7k3E/TMLbq0/c7Xgi+JgC0uQd+wIPZhQe92P3O7eGH858X0vsxG0FVzgnEAlHVLmqBCwqxMU5CsBp0JCTVIbtp+JNmveCsfLagP6mi39rUudbueXJQgqLv7H7Zw+ZNINLLaKPNVO6Od8sX3c+CSUQ+Bm9bakYr628k/z0krTdNpLG7OGXWoT3XShW6HXB/z7o7hpuDXJW7HdyvmWv9GVyWLm2USNe7/3Ugs2zWZI1f+t6t+V3EVr3T+nR4zpY/ISdlTsLtV/Daebr0v/V0YlaM0UaASzz16ob3p1cfao7C7BZwKqOBKoSyHpnuLhd70wOtNrhhPDU9dWQBC/l6uojcMJ9lQMsxFmHj4JFqJYl7p/UXnq1vnYBo1P3A//IGl4gL1Hv8U0I14LT77/AMYH57mItgD0/VnE4bvPIFML/4cX7L9qpdLoOAAyfa5P9cAfzhUnVnRRLM016MpGtvY8SfbZ68Of1Xjz/dZ9/fBEcObXPHGX2QNuJRFiWJjRVKjO7ok0qfiVUEmuZr6I="); + // Comments this out for now, so it doesn't load the player profile // A better way to do this would check for the properties when getting the skull or the skin // Might change on the next version diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/particles/DustSpellColor.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/particles/DustSpellColor.java index f3cb0466b..31ff46ed1 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/particles/DustSpellColor.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/particles/DustSpellColor.java @@ -1,6 +1,6 @@ package mineplex.core.common.util.particles; -import org.bukkit.Color; +import java.awt.Color; public class DustSpellColor extends ParticleColor { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/bonuses/BonusManager.java b/Plugins/Mineplex.Core/src/mineplex/core/bonuses/BonusManager.java index 82598f8a4..d1a06f0a4 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/bonuses/BonusManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/bonuses/BonusManager.java @@ -152,7 +152,7 @@ public class BonusManager extends MiniClientPlugin implements I System.out.print("GM NULL"); } - _rewardManager = new RewardManager(_clientManager, _donationManager, _inventoryManager, petManager, statsManager, gadgetManager); + _rewardManager = new RewardManager(_clientManager, _donationManager, _inventoryManager, petManager, gadgetManager); _pollManager = pollManager; _statsManager = statsManager; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java index 45da3c37c..d6dd97153 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java @@ -170,6 +170,11 @@ public class GadgetPage extends ShopPageBase itemLore.add(C.cBlack); itemLore.add(C.cBlue + "Found in Gingerbread Chests"); } + else if (gadget.getCost(GlobalCurrency.TREASURE_SHARD) == -17) + { + itemLore.add(C.cBlack); + itemLore.add(C.cBlue + "Found in Love Chests"); + } //Rank Unlocks else if (gadget.getCost(GlobalCurrency.TREASURE_SHARD) == -10) 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 f916b9b7d..503f2897d 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 @@ -127,7 +127,7 @@ public class PetPage extends ShopPageBase itemLore.add(C.cBlue + "Bonus Item Unlocked with Power Play Club"); } } - + //Rank Unlocks else if (pet.getPrice() == -10) { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java index bc877fad4..d65253009 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java @@ -121,6 +121,7 @@ import mineplex.core.gadget.gadgets.morph.MorphCreeper; import mineplex.core.gadget.gadgets.morph.MorphDinnerbone; import mineplex.core.gadget.gadgets.morph.MorphEnderman; import mineplex.core.gadget.gadgets.morph.MorphGrimReaper; +import mineplex.core.gadget.gadgets.morph.MorphLoveDoctor; import mineplex.core.gadget.gadgets.morph.MorphMetalMan; import mineplex.core.gadget.gadgets.morph.MorphPig; import mineplex.core.gadget.gadgets.morph.MorphPumpkinKing; @@ -158,6 +159,7 @@ import mineplex.core.gadget.gadgets.particle.ParticleLegend; import mineplex.core.gadget.gadgets.particle.ParticleWingsAngel; import mineplex.core.gadget.gadgets.particle.ParticleWingsDemons; import mineplex.core.gadget.gadgets.particle.ParticleWingsInfernal; +import mineplex.core.gadget.gadgets.particle.ParticleWingsLove; import mineplex.core.gadget.gadgets.particle.ParticleWingsPixie; import mineplex.core.gadget.gadgets.particle.ParticleYinYang; import mineplex.core.gadget.gadgets.particle.candycane.ParticleCandyCane; @@ -172,12 +174,14 @@ import mineplex.core.gadget.gadgets.particle.shadow.ParticleFoot; import mineplex.core.gadget.gadgets.particle.titan.ParticleTitan; import mineplex.core.gadget.gadgets.particle.vampire.ParticleBlood; import mineplex.core.gadget.gadgets.particle.wisdom.ParticleEnchant; +import mineplex.core.gadget.gadgets.taunts.BlowAKissTaunt; import mineplex.core.gadget.gadgets.taunts.EternalTaunt; import mineplex.core.gadget.gadgets.wineffect.WinEffectBabyChicken; import mineplex.core.gadget.gadgets.wineffect.WinEffectFlames; import mineplex.core.gadget.gadgets.wineffect.WinEffectHalloween; import mineplex.core.gadget.gadgets.wineffect.WinEffectLavaTrap; import mineplex.core.gadget.gadgets.wineffect.WinEffectLightningStrike; +import mineplex.core.gadget.gadgets.wineffect.WinEffectLoveIsABattlefield; import mineplex.core.gadget.gadgets.wineffect.WinEffectMrPunchMan; import mineplex.core.gadget.gadgets.wineffect.WinEffectPodium; import mineplex.core.gadget.gadgets.wineffect.WinEffectRiseOfTheElderGuardian; @@ -398,6 +402,7 @@ public class GadgetManager extends MiniPlugin //addGadget(new MorphStray(this)); addGadget(new MorphSanta(this)); addGadget(new MorphDinnerbone(this)); + addGadget(new MorphLoveDoctor(this)); // Particles addGadget(new ParticleFoot(this)); @@ -422,6 +427,7 @@ public class GadgetManager extends MiniPlugin addGadget(new ParticleYinYang(this)); addGadget(new ParticleFreedom(this)); addGadget(new ParticleChristmasTree(this)); + addGadget(new ParticleWingsLove(this)); // Arrow Trails addGadget(new ArrowTrailFrostLord(this)); @@ -487,6 +493,7 @@ public class GadgetManager extends MiniPlugin addGadget(new WinEffectLavaTrap(this)); addGadget(new WinEffectHalloween(this)); addGadget(new WinEffectWinterWarfare(this)); + addGadget(new WinEffectLoveIsABattlefield(this)); // Music addGadget(new MusicGadget(this, "13 Disc", new String[] {""}, -2, 2256, 178000)); @@ -549,6 +556,7 @@ public class GadgetManager extends MiniPlugin // TAUNTS!!! addGadget(new EternalTaunt(this)); + addGadget(new BlowAKissTaunt(this)); for (GadgetType gadgetType : GadgetType.values()) { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/commands/UnlockCosmeticsCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/commands/UnlockCosmeticsCommand.java index 1381fe628..d18f05207 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/commands/UnlockCosmeticsCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/commands/UnlockCosmeticsCommand.java @@ -22,7 +22,7 @@ public class UnlockCosmeticsCommand extends CommandBase public UnlockCosmeticsCommand(GadgetManager plugin) { - super(plugin, Rank.JNR_DEV, "unlockCosmetics"); + super(plugin, Rank.SNR_MODERATOR, "unlockCosmetics"); _plugin = plugin; } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailHalloween.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailHalloween.java index 26723da8e..bd5b62563 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailHalloween.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailHalloween.java @@ -1,9 +1,9 @@ package mineplex.core.gadget.gadgets.arrowtrail; +import java.awt.Color; import java.util.HashMap; import java.util.Map; -import org.bukkit.Color; import org.bukkit.Material; import org.bukkit.entity.Arrow; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/freedom/ArrowTrailFreedom.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/freedom/ArrowTrailFreedom.java index faeeecf75..8921b26cc 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/freedom/ArrowTrailFreedom.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/freedom/ArrowTrailFreedom.java @@ -1,7 +1,8 @@ package mineplex.core.gadget.gadgets.arrowtrail.freedom; +import java.awt.Color; + import org.bukkit.ChatColor; -import org.bukkit.Color; import org.bukkit.Material; import org.bukkit.entity.Arrow; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpHalloween.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpHalloween.java index 8381c5a93..0f2cc13e8 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpHalloween.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpHalloween.java @@ -1,10 +1,10 @@ package mineplex.core.gadget.gadgets.doublejump; +import java.awt.Color; import java.util.HashMap; import java.util.Iterator; import java.util.Map; -import org.bukkit.Color; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.entity.Player; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphLoveDoctor.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphLoveDoctor.java new file mode 100644 index 000000000..1a96f75d1 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphLoveDoctor.java @@ -0,0 +1,93 @@ +package mineplex.core.gadget.gadgets.morph; + +import java.util.HashSet; + +import org.bukkit.Bukkit; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.player.PlayerToggleSneakEvent; + +import com.mojang.authlib.GameProfile; + +import mineplex.core.common.skin.SkinData; +import mineplex.core.common.util.C; +import mineplex.core.common.util.F; +import mineplex.core.common.util.LineFormat; +import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilText; +import mineplex.core.disguise.disguises.DisguisePlayer; +import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.event.GadgetSelectLocationEvent; +import mineplex.core.gadget.gadgets.morph.managers.UtilMorph; +import mineplex.core.gadget.types.MorphGadget; +import mineplex.core.particleeffects.LoveDoctorEffect; +import mineplex.core.recharge.Recharge; +import mineplex.core.utils.UtilGameProfile; + +public class MorphLoveDoctor extends MorphGadget +{ + + public MorphLoveDoctor(GadgetManager manager) + { + super(manager, "Love Doctor", UtilText.splitLinesToArray(new String[]{C.cGray + "The Doctor is in! Sneak to diagnose players with cooties!"}, LineFormat.LORE), + -17, Material.GLASS, (byte) 0); + setDisplayItem(SkinData.LOVE_DOCTOR.getSkull()); + } + + @Override + public void enableCustom(Player player, boolean message) + { + applyArmor(player, message); + + GameProfile gameProfile = UtilGameProfile.getGameProfile(player); + gameProfile.getProperties().clear(); + gameProfile.getProperties().put("textures", SkinData.LOVE_DOCTOR.getProperty()); + + DisguisePlayer disguisePlayer = new DisguisePlayer(player, gameProfile); + disguisePlayer.showInTabList(true, 0); + UtilMorph.disguise(player, disguisePlayer, Manager); + } + + @Override + public void disableCustom(Player player, boolean message) + { + removeArmor(player); + + UtilMorph.undisguise(player, Manager.getDisguiseManager()); + } + + @EventHandler + public void onSneak(PlayerToggleSneakEvent event) + { + if (!isActive(event.getPlayer())) + return; + + Player player = event.getPlayer(); + + if (!Recharge.Instance.use(player, "Love Doctor Laser", 5000, true, false, "Cosmetics")) + return; + + HashSet ignore = new HashSet(); + ignore.add(Material.AIR); + Location loc = player.getTargetBlock(ignore, 64).getLocation().add(0.5, 0.5, 0.5); + + GadgetSelectLocationEvent gadgetSelectLocationEvent = new GadgetSelectLocationEvent(player, this, loc); + Bukkit.getServer().getPluginManager().callEvent(gadgetSelectLocationEvent); + + // Checks to see if it's a valid location + if (gadgetSelectLocationEvent.isCancelled()) + { + if (gadgetSelectLocationEvent.canShowMessage()) + { + UtilPlayer.message(player, F.main("Gadget", "You cannot use the laser on this area!")); + } + + return; + } + LoveDoctorEffect loveDoctorEffect = new LoveDoctorEffect(player, loc, this); + loveDoctorEffect.start(); + } + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleWingsLove.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleWingsLove.java new file mode 100644 index 000000000..3ad307040 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleWingsLove.java @@ -0,0 +1,59 @@ +package mineplex.core.gadget.gadgets.particle; + +import java.awt.Color; + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.potion.PotionType; +import org.bukkit.util.Vector; + +import mineplex.core.common.shape.ShapeWings; +import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; +import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilText; +import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.types.ParticleGadget; +import mineplex.core.itemstack.ItemStackFactory; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; + +public class ParticleWingsLove extends ParticleGadget +{ + + private ShapeWings _wings = new ShapeWings(UtilParticle.ParticleType.RED_DUST.particleName, new Vector(1, 1, 1), 1, 0, false, ShapeWings.DEFAULT_ROTATION, ShapeWings.HEART_WING_PATTERN); + private ShapeWings _wingsWhite = new ShapeWings(UtilParticle.ParticleType.RED_DUST.particleName, new Vector(1, 1, 1), 1, 0, '%', ShapeWings.DEFAULT_ROTATION, ShapeWings.HEART_WING_PATTERN); + private ShapeWings _wingsEdge = new ShapeWings(UtilParticle.ParticleType.RED_DUST.particleName, new Vector(1, 1, 1), 1, 0, true, ShapeWings.DEFAULT_ROTATION, ShapeWings.HEART_WING_PATTERN); + + public ParticleWingsLove(GadgetManager manager) + { + super(manager, "Love Wings", + UtilText.splitLineToArray(C.cGray + "Sometimes Love just makes you want to fly.", LineFormat.LORE), + -17, Material.NETHER_STAR, (byte) 0); + setDisplayItem(ItemStackFactory.Instance.createCustomPotion(PotionType.INSTANT_HEAL)); + } + + @Override + public void playParticle(Player player, UpdateEvent event) + { + Location loc = player.getLocation().add(0, 1.2, 0).add(player.getLocation().getDirection().multiply(-0.2)); + if (Manager.isMoving(player)) + { + if (event.getType() == UpdateType.TICK) + { + _wings.displayColoredParticle(loc, Color.PINK); + _wingsWhite.displayColoredParticle(loc, Color.WHITE); + _wingsEdge.displayColoredParticle(loc, Color.BLACK); + } + return; + } + + if (event.getType() == UpdateType.FAST) + { + _wings.displayColored(loc, Color.PINK); + _wingsWhite.displayColored(loc, Color.WHITE); + _wingsEdge.displayColored(loc, Color.BLACK); + } + } +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/taunts/BlowAKissTaunt.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/taunts/BlowAKissTaunt.java new file mode 100644 index 000000000..aa16f3bcc --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/taunts/BlowAKissTaunt.java @@ -0,0 +1,62 @@ +package mineplex.core.gadget.gadgets.taunts; + +import java.util.HashSet; + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.potion.PotionType; + +import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; +import mineplex.core.common.util.UtilText; +import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.types.TauntGadget; +import mineplex.core.itemstack.ItemStackFactory; +import mineplex.core.particleeffects.BlowAKissEffect; +import mineplex.core.recharge.Recharge; + +public class BlowAKissTaunt extends TauntGadget +{ + + private static final int COOLDOWN = 30000; + private static final int PVP_COOLDOWN = 10000; + + public BlowAKissTaunt(GadgetManager manager) + { + super(manager, "Blow A Kiss", UtilText.splitLinesToArray(new String[]{ + C.cWhite + "Type /taunt in game to blow a kiss at your enemies.", + C.cRed + "Cannot be used while in PvP!"}, LineFormat.LORE), + -17, Material.GLASS, (byte) 0); + setDisplayItem(ItemStackFactory.Instance.createCustomPotion(PotionType.INSTANT_HEAL)); + setCanPlayWithPvp(false); + setPvpCooldown(PVP_COOLDOWN); + setShouldPlay(false); + } + + @Override + public void onStart(Player player) + { + if (!Recharge.Instance.use(player, getName(), COOLDOWN, true, false, "Cosmetics")) + return; + + HashSet ignore = new HashSet<>(); + ignore.add(Material.AIR); + Location loc = player.getTargetBlock(ignore, 64).getLocation().add(0.5, 0.5, 0.5); + + BlowAKissEffect blowAKissEffect = new BlowAKissEffect(player, loc, this); + blowAKissEffect.start(); + } + + @Override + public void onPlay(Player player) + { + + } + + @Override + public void onFinish(Player player) + { + + } +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/taunts/EternalTaunt.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/taunts/EternalTaunt.java index 68a926d15..d68c4382f 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/taunts/EternalTaunt.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/taunts/EternalTaunt.java @@ -56,12 +56,6 @@ public class EternalTaunt extends TauntGadget addDisabledGames(GameType.SMASH, GameType.SMASHTEAMS, GameType.SMASHDOMINATION); } - @Override - public void disableCustom(Player player, boolean message) - { - finish(player); - } - @Override public void onStart(Player player) { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/wineffect/WinEffectHalloween.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/wineffect/WinEffectHalloween.java index 821a9daff..d40136327 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/wineffect/WinEffectHalloween.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/wineffect/WinEffectHalloween.java @@ -1,9 +1,9 @@ package mineplex.core.gadget.gadgets.wineffect; +import java.awt.Color; import java.util.ArrayList; import java.util.List; -import org.bukkit.Color; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Sound; @@ -26,8 +26,8 @@ import mineplex.core.common.util.particles.ColoredParticle; import mineplex.core.common.util.particles.DustSpellColor; import mineplex.core.disguise.disguises.DisguisePlayer; import mineplex.core.gadget.GadgetManager; -import mineplex.core.particleeffects.BabyFireworkEffect; import mineplex.core.gadget.types.WinEffectGadget; +import mineplex.core.particleeffects.BabyFireworkEffect; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import mineplex.core.utils.UtilVariant; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/wineffect/WinEffectLoveIsABattlefield.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/wineffect/WinEffectLoveIsABattlefield.java new file mode 100644 index 000000000..9b31c73fa --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/wineffect/WinEffectLoveIsABattlefield.java @@ -0,0 +1,136 @@ +package mineplex.core.gadget.gadgets.wineffect; + +import java.util.ArrayList; +import java.util.List; + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.entity.ArmorStand; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.util.Vector; + +import mineplex.core.common.animation.AnimationPoint; +import mineplex.core.common.animation.AnimatorEntity; +import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; +import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilShapes; +import mineplex.core.common.util.UtilText; +import mineplex.core.disguise.disguises.DisguisePlayer; +import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.types.WinEffectGadget; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; + +public class WinEffectLoveIsABattlefield extends WinEffectGadget +{ + + private DisguisePlayer _npc; + private int _ticks = 0; + private List _nonTeamArmorStands = new ArrayList<>(); + + public WinEffectLoveIsABattlefield(GadgetManager manager) + { + super(manager, "Love is a Battlefield", UtilText.splitLineToArray(C.cGray + "Don't hate the players. Hate the game.", LineFormat.LORE), + -17, Material.WOOL, (byte) 6); + _schematicName = "WinRoomLove"; + } + + @Override + public void teleport() + { + Location loc = getBaseLocation().add(getBaseLocation().getDirection().normalize().multiply(17)).add(0, 3, 0); + loc.setDirection(getBaseLocation().clone().subtract(loc).toVector()); + super.teleport(loc); + } + + @Override + public void play() + { + _npc = getNPC(this._player, getBaseLocation()); + + AnimatorEntity animator = new AnimatorEntity(Manager.getPlugin(), _npc.getEntity().getBukkitEntity()); + + animator.addPoint(new AnimationPoint(20, new Vector(0,0,0), new Vector(-1, 0.5, 0))); + animator.addPoint(new AnimationPoint(40, new Vector(0,0,0), new Vector( 0, 0.5,-1))); + animator.addPoint(new AnimationPoint(60, new Vector(0,0,0), new Vector( 1, 0.5, 0))); + animator.addPoint(new AnimationPoint(80, new Vector(0,0,0), new Vector( 0, 0.5, 1))); + + animator.setRepeat(true); + + Location loc = _npc.getEntity().getBukkitEntity().getLocation(); + loc.setDirection(new Vector(0, 0.5, 1)); + animator.start(loc); + + spawnNonTeam(); + } + + @EventHandler + public void onUpdate(UpdateEvent event) + { + + if(!isRunning()) return; + + if (event.getType() == UpdateType.TICK) + { + _ticks++; + if (_ticks == 70) + knockPlayers(); + } + + if(event.getType() == UpdateType.FASTER) + { + _npc.sendHit(); + } + + if(event.getType() != UpdateType.FAST) return; + + Location loc = getBaseLocation(); + + for(int i = 0; i < 3; i++) + { + double r = 3; + double rad = (((Math.PI*2)/3.0)*i) + ((event.getTick()%240) * Math.PI/120.0); + double x = Math.sin(rad) * r; + double z = Math.cos(rad) * r; + + Location l = loc.clone().add(x, 0, z); + UtilParticle.PlayParticle(UtilParticle.ParticleType.HEART, l, 0.75f, 0.75f, 0.75f, 0.5f, 5, UtilParticle.ViewDist.NORMAL); + } + } + + @Override + public void finish() + { + Manager.getDisguiseManager().undisguise(_npc); + _npc = null; + } + + private void knockPlayers() + { + for (ArmorStand armorStand : _nonTeamArmorStands) + { + armorStand.setVelocity(armorStand.getLocation().getDirection().multiply(-1).multiply(5)); + } + } + + private void spawnNonTeam() + { + int i = 0; + List circle = UtilShapes.getPointsInCircle(getBaseLocation(), _nonTeam.size(), 2.5); + for (Player player : _nonTeam) + { + Location loc = circle.get(i); + DisguisePlayer disguisePlayer = getNPC(player, loc); + ArmorStand armorStand = (ArmorStand) disguisePlayer.getEntity().getBukkitEntity(); + Vector direction = _player.getEyeLocation().toVector().subtract(armorStand.getEyeLocation().toVector()); + Location teleport = armorStand.getLocation().setDirection(direction); + armorStand.teleport(teleport); + armorStand.setGravity(true); + _nonTeamArmorStands.add(armorStand); + i++; + } + } + +} \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/Gadget.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/Gadget.java index 2dc93ebf5..141885d0c 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/Gadget.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/Gadget.java @@ -184,7 +184,7 @@ public abstract class Gadget extends SalesPackageBase implements Listener public boolean ownsGadget(Player player) { - if(isFree() || _free) return true; + if(isFree() || _free) { return true; } if(Manager.getDonationManager().Get(player).ownsUnknownSalesPackage(getName())) { return true; } if(Manager.getInventoryManager().Get(player).getItemCount(getName()) > 0) { return true; } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/TauntGadget.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/TauntGadget.java index f1bce90be..6076bcf0c 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/TauntGadget.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/TauntGadget.java @@ -67,6 +67,12 @@ public abstract class TauntGadget extends Gadget super(manager, GadgetType.TAUNT, name, desc, cost, mat, data, yearMonth, 1, alternativeSalesPackageNames); } + @Override + public void disableCustom(Player player, boolean message) + { + finish(player); + } + public void start(Player player) { onStart(player); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/itemstack/ItemStackFactory.java b/Plugins/Mineplex.Core/src/mineplex/core/itemstack/ItemStackFactory.java index 7a06c5bf2..8ca03762a 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/itemstack/ItemStackFactory.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/itemstack/ItemStackFactory.java @@ -32,6 +32,8 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.inventory.meta.LeatherArmorMeta; import org.bukkit.plugin.java.JavaPlugin; +import org.bukkit.potion.Potion; +import org.bukkit.potion.PotionType; import mineplex.core.MiniPlugin; import mineplex.core.common.util.C; @@ -1092,4 +1094,28 @@ public class ItemStackFactory extends MiniPlugin stack.setItemMeta(leatherArmorMeta); return stack; } + + /** + * Creates a potion item stack + * @param potionType + * @param level + * @return + */ + public ItemStack createCustomPotion(PotionType potionType, int level) + { + Potion potion = new Potion(potionType, level); + return potion.toItemStack(1); + } + + /** + * Creates a potion item stack + * @param potionType + * @return + */ + public ItemStack createCustomPotion(PotionType potionType) + { + return createCustomPotion(potionType, 1); + } + + } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mount/MountManager.java b/Plugins/Mineplex.Core/src/mineplex/core/mount/MountManager.java index 45a94cb2b..869f8e261 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/mount/MountManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/mount/MountManager.java @@ -30,6 +30,7 @@ import mineplex.core.mount.types.MountChicken; import mineplex.core.mount.types.MountDragon; import mineplex.core.mount.types.MountFreedomHorse; import mineplex.core.mount.types.MountFrost; +import mineplex.core.mount.types.MountLoveTrain; import mineplex.core.mount.types.MountMule; import mineplex.core.mount.types.MountNightmareSteed; import mineplex.core.mount.types.MountSlime; @@ -81,6 +82,7 @@ public class MountManager extends MiniPlugin // Hidden in this update _types.add(new MountChicken(this)); _types.add(new MountCake(this)); + _types.add(new MountLoveTrain(this)); //_types.add(new MountSheep(this)); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountLoveTrain.java b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountLoveTrain.java new file mode 100644 index 000000000..936bcaeff --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountLoveTrain.java @@ -0,0 +1,138 @@ +package mineplex.core.mount.types; + +import org.bukkit.Material; +import org.bukkit.Sound; +import org.bukkit.entity.Horse; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.inventory.ItemStack; + +import mineplex.core.common.util.C; +import mineplex.core.common.util.F; +import mineplex.core.common.util.LineFormat; +import mineplex.core.common.util.UtilAction; +import mineplex.core.common.util.UtilAlg; +import mineplex.core.common.util.UtilEnt; +import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilText; +import mineplex.core.disguise.disguises.DisguiseBlock; +import mineplex.core.mount.HorseMount; +import mineplex.core.mount.MountManager; +import mineplex.core.mount.SingleEntityMountData; +import mineplex.core.recharge.Recharge; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; +import mineplex.core.utils.UtilVariant; + +public class MountLoveTrain extends HorseMount +{ + + public MountLoveTrain(MountManager manager) + { + super(manager, "Love Train", + UtilText.splitLinesToArray(new String[]{C.cGray + "Woo Woo! All aboard!"}, LineFormat.LORE), + Material.WOOL, (byte) 6, -17, Horse.Color.BLACK, Horse.Style.NONE, Horse.Variant.HORSE, 2.0, Material.AIR); + } + + @Override + public void enableCustom(Player player) + { + player.leaveVehicle(); + player.eject(); + + //Remove other mounts + Manager.DeregisterAll(player); + + Horse horse = UtilVariant.spawnHorse(player.getLocation(), _variant); + horse.setAdult(); + horse.setAgeLock(true); + horse.setColor(_color); + horse.setStyle(_style); + horse.setOwner(player); + horse.setMaxDomestication(1); + horse.setJumpStrength(_jump); + horse.setMaxHealth(20); + horse.setHealth(horse.getMaxHealth()); + horse.getInventory().setSaddle(new ItemStack(Material.SADDLE)); + + if (horse.getVariant() == Horse.Variant.MULE) + horse.setCarryingChest(true); + + if (_armor != null) + horse.getInventory().setArmor(new ItemStack(_armor)); + + horse.setCustomName(player.getName() + "'s " + getName()); + + //Inform + UtilPlayer.message(player, F.main("Mount", "You spawned " + F.elem(getName()) + ".")); + + //Store + SingleEntityMountData mount = new SingleEntityMountData<>(player, horse); + _active.put(player, mount); + + DisguiseBlock block = new DisguiseBlock(horse, Material.BARRIER.getId(), 0); + Manager.getDisguiseManager().disguise(block); + + UtilEnt.silence(horse, true); + } + + @EventHandler + public void updateBounce(UpdateEvent event) + { + if (event.getType() != UpdateType.TICK) + return; + + //Collide + for (SingleEntityMountData loveTrainData : getActive().values()) + { + Horse loveTrain = loveTrainData.getEntity(); + + UtilParticle.PlayParticle(UtilParticle.ParticleType.HEART, loveTrain.getLocation(), 0.25f, 0.25f, 0.25f, 0.5f, 3, UtilParticle.ViewDist.NORMAL); + + if (loveTrain.getPassenger() == null) + continue; + + if (!(loveTrain.getPassenger() instanceof Player)) + continue; + + Player player = (Player) loveTrain.getPassenger(); + + if (!Recharge.Instance.usable(player, getName() + " Collide")) + continue; + + for (SingleEntityMountData otherData : getActive().values()) + { + Horse other = otherData.getEntity(); + if (other.equals(loveTrain)) + continue; + + if (other.getPassenger() == null) + continue; + + if (!(other.getPassenger() instanceof Player)) + continue; + + Player otherPlayer = (Player)other.getPassenger(); + + if (!Recharge.Instance.usable(otherPlayer, getName() + " Collide")) + continue; + + //Collide + if (UtilMath.offset(loveTrain, other) > 2) + continue; + + Recharge.Instance.useForce(player, getName() + " Collide", 500); + Recharge.Instance.useForce(otherPlayer, getName() + " Collide", 500); + + UtilAction.velocity(loveTrain, UtilAlg.getTrajectory(other, loveTrain), 1.2, false, 0, 0.8, 10, true); + UtilAction.velocity(other, UtilAlg.getTrajectory(loveTrain, other), 1.2, false, 0, 0.8, 10, true); + + loveTrain.getWorld().playSound(loveTrain.getLocation(), Sound.SLIME_WALK, 1f, 0.75f); + other.getWorld().playSound(other.getLocation(), Sound.SLIME_WALK, 1f, 0.75f); + } + } + } + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountNightmareSteed.java b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountNightmareSteed.java index 1e2459c3b..a58b5ef66 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountNightmareSteed.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountNightmareSteed.java @@ -1,18 +1,10 @@ package mineplex.core.mount.types; +import java.awt.Color; import java.util.HashMap; import java.util.Iterator; import java.util.Map; -import mineplex.core.common.util.*; -import mineplex.core.common.util.particles.ColoredParticle; -import mineplex.core.common.util.particles.DustSpellColor; -import mineplex.core.mount.HorseMount; -import mineplex.core.mount.MountManager; -import mineplex.core.mount.SingleEntityMountData; -import mineplex.core.updater.UpdateType; -import mineplex.core.updater.event.UpdateEvent; -import org.bukkit.Color; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.BlockFace; @@ -21,6 +13,24 @@ import org.bukkit.entity.Horse; import org.bukkit.event.EventHandler; import org.bukkit.util.Vector; +import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; +import mineplex.core.common.util.UtilAlg; +import mineplex.core.common.util.UtilBlock; +import mineplex.core.common.util.UtilEnt; +import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilText; +import mineplex.core.common.util.UtilTime; +import mineplex.core.common.util.particles.ColoredParticle; +import mineplex.core.common.util.particles.DustSpellColor; +import mineplex.core.mount.HorseMount; +import mineplex.core.mount.MountManager; +import mineplex.core.mount.SingleEntityMountData; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; + public class MountNightmareSteed extends HorseMount { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/BabyFireworkEffect.java b/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/BabyFireworkEffect.java index 98d1b2a35..fc85c203f 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/BabyFireworkEffect.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/BabyFireworkEffect.java @@ -1,8 +1,8 @@ package mineplex.core.particleeffects; +import java.awt.Color; import java.util.Random; -import org.bukkit.Color; import org.bukkit.Location; import org.bukkit.plugin.java.JavaPlugin; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/BlowAKissEffect.java b/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/BlowAKissEffect.java new file mode 100644 index 000000000..066521459 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/BlowAKissEffect.java @@ -0,0 +1,85 @@ +package mineplex.core.particleeffects; + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.Sound; +import org.bukkit.entity.Player; +import org.bukkit.util.Vector; + +import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilServer; +import mineplex.core.gadget.types.Gadget; + +public class BlowAKissEffect extends Effect +{ + + private int _particles = 100; + private int _count = 0; + private Vector _vector; + private Location _fixedLoc; + private Gadget _gadget; + private Player _player; + + public BlowAKissEffect(Player player, Location target, Gadget gadget) + { + super(-1, new EffectLocation(player), gadget.Manager.getPlugin()); + _gadget = gadget; + _player = player; + setTargetLocation(new EffectLocation(target)); + } + + @Override + public void onStart() + { + _player.getWorld().playSound(_player.getLocation(), Sound.PISTON_RETRACT, 1f, 1f); + } + + @Override + public void runEffect() + { + Location location = _effectLocation.getFixedLocation().clone().add(0, 1, 0); + if (_vector == null) + { + Location targetLoc = getTargetLocation().getFixedLocation().clone(); + Vector link = targetLoc.toVector().subtract(location.toVector()); + float length = (float) link.length(); + link.normalize(); + _vector = link.multiply(length / _particles); + _fixedLoc = location.clone().subtract(_vector); + } + for (int i = 0; i < 5; i++){ + _fixedLoc.add(_vector); + UtilParticle.PlayParticle(UtilParticle.ParticleType.HEART, _fixedLoc, 0, 0, 0, 0, 2, UtilParticle.ViewDist.LONG); + } + if (checkPlayer()) + { + stop(); + return; + } + if (_fixedLoc.getBlock().getType() != Material.AIR || _count >= 1000) + { + UtilServer.broadcast(F.main("Blow A Kiss", F.name(_player.getName()) + " wanted to kiss someone but no one was around!")); + stop(); + } + _count += 5; + } + + private boolean checkPlayer() + { + for (Player player : UtilServer.getPlayers()) + { + if (player.equals(_player)) + continue; + + if (player.getLocation().distanceSquared(_fixedLoc) <= 2.25) + { + UtilParticle.PlayParticle(UtilParticle.ParticleType.HEART, player.getLocation(), 0.25f, 0.25f, 0.25f, 0.5f, 7, UtilParticle.ViewDist.NORMAL); + UtilServer.broadcast(F.main("Blow A Kiss", F.name(_player.getName()) + " blows a kiss at " + F.name(player.getName()) + "!")); + return true; + } + } + return false; + } + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/ChristmasTreeEffect.java b/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/ChristmasTreeEffect.java index 07ade841a..bc2da7ac4 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/ChristmasTreeEffect.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/ChristmasTreeEffect.java @@ -1,6 +1,7 @@ package mineplex.core.particleeffects; -import org.bukkit.Color; +import java.awt.Color; + import org.bukkit.Location; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; @@ -39,7 +40,7 @@ public class ChristmasTreeEffect extends Effect if (_manager.isMoving(_player)) { Location loc = _player.getLocation().add(0, 1.2, 0).add(_player.getLocation().getDirection().multiply(-0.2)); - ColoredParticle coloredParticle = new ColoredParticle(UtilParticle.ParticleType.RED_DUST, new DustSpellColor(Color.MAROON), loc); + ColoredParticle coloredParticle = new ColoredParticle(UtilParticle.ParticleType.RED_DUST, new DustSpellColor(new Color(8388608)), loc); coloredParticle.display(); coloredParticle.setColor(new DustSpellColor(Color.GREEN)); coloredParticle.display(); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/CircleEffect.java b/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/CircleEffect.java index ef5e25dfb..8d1ae23d1 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/CircleEffect.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/CircleEffect.java @@ -1,9 +1,9 @@ package mineplex.core.particleeffects; +import java.awt.Color; import java.util.ArrayList; import java.util.List; -import org.bukkit.Color; import org.bukkit.Location; import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.util.Vector; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/FreedomFireworkEffect.java b/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/FreedomFireworkEffect.java index 8ea666184..c89fd92cf 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/FreedomFireworkEffect.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/FreedomFireworkEffect.java @@ -1,6 +1,7 @@ package mineplex.core.particleeffects; -import org.bukkit.Color; +import java.awt.Color; + import org.bukkit.Location; import org.bukkit.entity.Entity; import org.bukkit.plugin.java.JavaPlugin; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/FreedomTrailEffect.java b/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/FreedomTrailEffect.java index 86f55dfa1..373b6c570 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/FreedomTrailEffect.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/FreedomTrailEffect.java @@ -1,6 +1,7 @@ package mineplex.core.particleeffects; -import org.bukkit.Color; +import java.awt.Color; + import org.bukkit.FireworkEffect; import org.bukkit.entity.Entity; import org.bukkit.plugin.java.JavaPlugin; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/LineEffect.java b/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/LineEffect.java index 8698761dd..3f1612f79 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/LineEffect.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/LineEffect.java @@ -1,6 +1,7 @@ package mineplex.core.particleeffects; -import org.bukkit.Color; +import java.awt.Color; + import org.bukkit.Location; import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.util.Vector; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/LoveDoctorEffect.java b/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/LoveDoctorEffect.java new file mode 100644 index 000000000..85c293e6f --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/LoveDoctorEffect.java @@ -0,0 +1,94 @@ +package mineplex.core.particleeffects; + +import java.util.HashMap; + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.Sound; +import org.bukkit.entity.Player; +import org.bukkit.util.Vector; + +import mineplex.core.common.util.UtilAction; +import mineplex.core.common.util.UtilAlg; +import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilServer; +import mineplex.core.gadget.types.Gadget; + +public class LoveDoctorEffect extends Effect +{ + + private int _particles = 100; + private int _count = 0; + private Vector _vector; + private Location _fixedLoc; + private Gadget _gadget; + private Player _player; + private boolean _forceStop = false; + + public LoveDoctorEffect(Player player, Location target, Gadget gadget) + { + super(-1, new EffectLocation(player), gadget.Manager.getPlugin()); + _gadget = gadget; + _player = player; + setTargetLocation(new EffectLocation(target)); + } + + @Override + public void onStart() + { + _player.getWorld().playSound(_player.getLocation(), Sound.PISTON_RETRACT, 1f, 1f); + } + + @Override + public void runEffect() + { + Location location = _effectLocation.getFixedLocation().clone().add(0, 1, 0); + if (_vector == null) + { + Location targetLoc = getTargetLocation().getFixedLocation().clone(); + Vector link = targetLoc.toVector().subtract(location.toVector()); + float length = (float) link.length(); + link.normalize(); + _vector = link.multiply(length / _particles); + _fixedLoc = location.clone().subtract(_vector); + } + for (int i = 0; i < 5; i++){ + _fixedLoc.add(_vector); + UtilParticle.PlayParticle(UtilParticle.ParticleType.HEART, _fixedLoc, 0, 0, 0, 0, 1, UtilParticle.ViewDist.LONG); + } + if (_fixedLoc.getBlock().getType() != Material.AIR ) + { + stop(); + } + else if (_count >= 1000) + { + _forceStop = true; + stop(); + } + _count += 5; + } + + @Override + public void onStop() + { + // Creates the explosion and knockback players + Location loc = _fixedLoc; + loc.getWorld().createExplosion(loc, 0f); + UtilParticle.PlayParticle(UtilParticle.ParticleType.EXPLODE, loc, 3f, 3f, 3f, 0, 32, UtilParticle.ViewDist.MAX, UtilServer.getPlayers()); + HashMap players = UtilPlayer.getInRadius(loc, 9d); + for (Player ent : players.keySet()) + { + if (_gadget.Manager.collideEvent(_player, _gadget, ent)) + continue; + + double mult = players.get(ent); + + //Knockback + UtilAction.velocity(ent, UtilAlg.getTrajectory(loc, ent.getLocation()), 2 * mult, false, 0, 1 + 1 * mult, 10, true); + LoveDoctorHitEffect loveDoctorHitEffect = new LoveDoctorHitEffect(ent); + loveDoctorHitEffect.start(); + } + } + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/LoveDoctorHitEffect.java b/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/LoveDoctorHitEffect.java new file mode 100644 index 000000000..5b7678fa1 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/LoveDoctorHitEffect.java @@ -0,0 +1,24 @@ +package mineplex.core.particleeffects; + +import org.bukkit.Location; +import org.bukkit.entity.Player; + +import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilServer; + +public class LoveDoctorHitEffect extends Effect +{ + + public LoveDoctorHitEffect(Player player) + { + super(200, new EffectLocation(player.getLocation()), UtilServer.getPlugin()); + } + + @Override + public void runEffect() + { + Location location = getEffectLocation().getLocation(); + UtilParticle.PlayParticle(UtilParticle.ParticleType.HEART, location.clone().add(0, 1, 0), 0.75f, 0.75f, 0.75f, 0, 1, UtilParticle.ViewDist.NORMAL); + } + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/MetalManEffect.java b/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/MetalManEffect.java index bb5615b72..d9382e15e 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/MetalManEffect.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/MetalManEffect.java @@ -1,9 +1,9 @@ package mineplex.core.particleeffects; +import java.awt.Color; import java.util.HashMap; import java.util.HashSet; -import org.bukkit.Color; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Sound; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/TextEffect.java b/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/TextEffect.java index 93f0e4f5c..93c5a8883 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/TextEffect.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/particleeffects/TextEffect.java @@ -3,7 +3,6 @@ package mineplex.core.particleeffects; import java.awt.*; import java.awt.image.BufferedImage; -import org.bukkit.Color; import org.bukkit.Location; import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.util.Vector; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/pet/PetManager.java b/Plugins/Mineplex.Core/src/mineplex/core/pet/PetManager.java index e9c7ff2e4..ce936a333 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/pet/PetManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/pet/PetManager.java @@ -1,5 +1,6 @@ package mineplex.core.pet; +import java.awt.Color; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; @@ -11,7 +12,6 @@ import net.minecraft.server.v1_8_R3.EntityCreature; import net.minecraft.server.v1_8_R3.NavigationAbstract; import org.bukkit.Bukkit; -import org.bukkit.Color; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.SkullType; @@ -42,6 +42,7 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; +import org.bukkit.util.Vector; import com.google.gson.Gson; @@ -65,6 +66,7 @@ import mineplex.core.common.util.UtilServer; import mineplex.core.disguise.DisguiseManager; import mineplex.core.disguise.disguises.DisguiseChicken; import mineplex.core.disguise.disguises.DisguiseGuardian; +import mineplex.core.disguise.disguises.DisguiseVillager; import mineplex.core.disguise.disguises.DisguiseWither; import mineplex.core.disguise.disguises.DisguiseZombie; import mineplex.core.donation.DonationManager; @@ -98,8 +100,12 @@ public class PetManager extends MiniClientPlugin private Map _flyingPets = new HashMap<>(); private Map _trueLovePets = new HashMap<>(); - private ShapeWings _wings = new ShapeWings(ParticleType.RED_DUST.particleName, new org.bukkit.util.Vector(0.2,0.2,0.2), 1, 0, false, ShapeWings.DEFAULT_ROTATION, ShapeWings.SMALL_ANGEL_WING_PATTERN); - private ShapeWings _wingsEdge = new ShapeWings(ParticleType.RED_DUST.particleName, new org.bukkit.util.Vector(0.1,0.1,0.1), 1, 0, true, ShapeWings.DEFAULT_ROTATION, ShapeWings.SMALL_ANGEL_WING_PATTERN); + private ShapeWings _grimReaperWings = new ShapeWings(ParticleType.RED_DUST.particleName, new org.bukkit.util.Vector(0.2, 0.2, 0.2), 1, 0, false, ShapeWings.DEFAULT_ROTATION, ShapeWings.SMALL_ANGEL_WING_PATTERN); + private ShapeWings _grimReaperWingsEdge = new ShapeWings(ParticleType.RED_DUST.particleName, new org.bukkit.util.Vector(0.1, 0.1, 0.1), 1, 0, true, ShapeWings.DEFAULT_ROTATION, ShapeWings.SMALL_ANGEL_WING_PATTERN); + + private ShapeWings _cupidWings = new ShapeWings(UtilParticle.ParticleType.RED_DUST.particleName, new Vector(1, 1, 1), 1, 0, false, ShapeWings.DEFAULT_ROTATION, ShapeWings.SMALL_HEART_WING_PATTERN); + private ShapeWings _cupidWingsWhite = new ShapeWings(UtilParticle.ParticleType.RED_DUST.particleName, new Vector(1, 1, 1), 1, 0, '%', ShapeWings.DEFAULT_ROTATION, ShapeWings.SMALL_HEART_WING_PATTERN); + private ShapeWings _cupidWingsEdge = new ShapeWings(UtilParticle.ParticleType.RED_DUST.particleName, new Vector(0, 0, 0), 1, 0, true, ShapeWings.DEFAULT_ROTATION, ShapeWings.SMALL_HEART_WING_PATTERN); public PetManager(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager , InventoryManager inventoryManager, DisguiseManager disguiseManager, mineplex.core.creature.Creature creatureModule, BlockRestore restore) @@ -336,9 +342,9 @@ public class PetManager extends MiniClientPlugin Zombie zombie = (Zombie) pet; zombie.setBaby(true); zombie.getEquipment().setHelmet(SkinData.GINGERBREAD.getSkull()); - zombie.getEquipment().setChestplate(ItemStackFactory.Instance.createColoredLeatherArmor(1, Color.fromRGB(203, 122, 56))); - zombie.getEquipment().setLeggings(ItemStackFactory.Instance.createColoredLeatherArmor(2, Color.fromRGB(203, 122, 56))); - zombie.getEquipment().setBoots(ItemStackFactory.Instance.createColoredLeatherArmor(3, Color.fromRGB(203, 122, 56))); + zombie.getEquipment().setChestplate(ItemStackFactory.Instance.createColoredLeatherArmor(1, org.bukkit.Color.fromRGB(203, 122, 56))); + zombie.getEquipment().setLeggings(ItemStackFactory.Instance.createColoredLeatherArmor(2, org.bukkit.Color.fromRGB(203, 122, 56))); + zombie.getEquipment().setBoots(ItemStackFactory.Instance.createColoredLeatherArmor(3, org.bukkit.Color.fromRGB(203, 122, 56))); UtilEnt.silence(zombie, true); @@ -348,6 +354,25 @@ public class PetManager extends MiniClientPlugin zombie.setCustomNameVisible(true); } } + else if (petType.equals(PetType.CUPID_PET)) + { + Zombie zombie = (Zombie) pet; + UtilEnt.silence(zombie, true); + + DisguiseVillager disguiseVillager = new DisguiseVillager(zombie); + disguiseVillager.setBaby(); + disguiseVillager.setHeldItem(new ItemStack(Material.BOW)); + + if (Get(player).getPets().get(entityType) != null && Get(player).getPets().get(entityType).length() > 0) + { + disguiseVillager.setName(Get(player).getPets().get(entityType)); + disguiseVillager.setCustomNameVisible(true); + } + + _disguiseManager.disguise(disguiseVillager); + FlyingPetManager flyingPetManager = new FlyingPetManager(player, pet); + _flyingPets.put(pet, flyingPetManager); + } else if (petType.equals(PetType.TRUE_LOVE_PET)) { Zombie zombie = (Zombie) pet; @@ -474,26 +499,56 @@ public class PetManager extends MiniClientPlugin @EventHandler public void onUpdate(UpdateEvent event) { - for(Creature pet : _activePetOwners.values()) + + for (Entry entry : _activePetOwners.entrySet()) { - if(pet instanceof PigZombie && event.getType() == UpdateType.TICK) + String playerName = entry.getKey(); + Creature creature = entry.getValue(); + + if (event.getType() == UpdateType.TICK) { - UtilParticle.PlayParticleToAll(ParticleType.LARGE_SMOKE, pet.getLocation(), 0.2f,0.0f,0.2f, 0.0f, 4, ViewDist.NORMAL); - if(event.getTick()%3 == 0) pet.getWorld().playSound(pet.getLocation(), Sound.BLAZE_BREATH, 0.03f, 0f); - if(!((CraftPigZombie)pet).getHandle().isSilent()) + if (creature instanceof PigZombie) { - ((CraftPigZombie)pet).getHandle().setSilent(true); + UtilParticle.PlayParticleToAll(ParticleType.LARGE_SMOKE, creature.getLocation(), 0.2f, 0.0f, 0.2f, 0.0f, 4, ViewDist.NORMAL); + if(event.getTick() % 3 == 0) creature.getWorld().playSound(creature.getLocation(), Sound.BLAZE_BREATH, 0.03f, 0f); + if(!((CraftPigZombie) creature).getHandle().isSilent()) + { + ((CraftPigZombie) creature).getHandle().setSilent(true); + } } } - if (pet instanceof Blaze && event.getType() == UpdateType.FAST) + else if (event.getType() == UpdateType.FAST) { - Location loc = pet.getLocation().clone().add(0, .5, 0).add(pet.getLocation().getDirection().multiply(-0.2)); + if (creature instanceof Blaze) + { + Location loc = creature.getLocation().clone().add(0, .5, 0).add(creature.getLocation().getDirection().multiply(-0.2)); + _grimReaperWings.display(loc); + _grimReaperWingsEdge.display(loc); + } + else + { + PetType petType = getActivePetType(playerName); + if (petType == PetType.CUPID_PET) + { + Location loc = creature.getLocation().clone().add(0, .5, 0).add(creature.getLocation().getDirection().multiply(-0.2)); - if (event.getType() == UpdateType.FAST) _wings.display(loc); - if (event.getType() == UpdateType.FAST) _wingsEdge.display(loc); + _cupidWings.displayColored(loc, Color.PINK); + _cupidWingsWhite.displayColored(loc, Color.WHITE); + _cupidWingsEdge.displayColored(loc, Color.BLACK); + } + } + } + else if (event.getType() == UpdateType.SEC) + { + PetType petType = getActivePetType(playerName); + if (petType == PetType.CUPID_PET) + { + Location loc = creature.getLocation().clone().add(0, .5, 0); + UtilParticle.PlayParticle(ParticleType.HEART, loc, 0.25f, 0.25f, 0.25f, 0.25f, 3, ViewDist.NORMAL); + } } } - + if (event.getType() != UpdateType.FAST) return; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/pet/PetType.java b/Plugins/Mineplex.Core/src/mineplex/core/pet/PetType.java index e9584308d..d3aba90ab 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/pet/PetType.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/pet/PetType.java @@ -29,6 +29,7 @@ public enum PetType RABBIT("Baby Zombie", EntityType.RABBIT, -9, "They're so cute - until a pack of them chases down your family and eats them."), BLAZE("Grim Reaper", EntityType.BLAZE, -8, "Aww isn't he so cute with his little wings and little scythe?"), GINGERBREAD_MAN("Gingerbread Man", EntityType.ZOMBIE, -16, "Looks like you can catch him after all."), + CUPID_PET("Cupid", EntityType.ZOMBIE, -17, "Sometimes you need a little extra help finding true Love. Why not have Cupid help you out?", Material.BOW, (byte) 0), TRUE_LOVE_PET("True Love", EntityType.ZOMBIE, -14, "Sometimes love means chasing the person of your dreams until you catch them.", Material.APPLE, YearMonth.of(2017, Month.FEBRUARY)) // TODO CHECK IF LOBBY IS 1.9+ // Not in this update diff --git a/Plugins/Mineplex.Core/src/mineplex/core/reward/RewardManager.java b/Plugins/Mineplex.Core/src/mineplex/core/reward/RewardManager.java index 4324c3682..8475fb95f 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/reward/RewardManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/reward/RewardManager.java @@ -73,6 +73,7 @@ import mineplex.core.gadget.gadgets.morph.MorphChicken; import mineplex.core.gadget.gadgets.morph.MorphCow; import mineplex.core.gadget.gadgets.morph.MorphEnderman; import mineplex.core.gadget.gadgets.morph.MorphGrimReaper; +import mineplex.core.gadget.gadgets.morph.MorphLoveDoctor; import mineplex.core.gadget.gadgets.morph.MorphPumpkinKing; import mineplex.core.gadget.gadgets.morph.MorphSlime; import mineplex.core.gadget.gadgets.morph.MorphSnowman; @@ -97,6 +98,7 @@ import mineplex.core.gadget.gadgets.particle.ParticleFireRings; import mineplex.core.gadget.gadgets.particle.ParticleWingsAngel; import mineplex.core.gadget.gadgets.particle.ParticleWingsDemons; import mineplex.core.gadget.gadgets.particle.ParticleWingsInfernal; +import mineplex.core.gadget.gadgets.particle.ParticleWingsLove; import mineplex.core.gadget.gadgets.particle.ParticleWingsPixie; import mineplex.core.gadget.gadgets.particle.ParticleYinYang; import mineplex.core.gadget.gadgets.particle.candycane.ParticleCandyCane; @@ -110,11 +112,13 @@ import mineplex.core.gadget.gadgets.particle.party.ParticlePartyTime; import mineplex.core.gadget.gadgets.particle.shadow.ParticleFoot; import mineplex.core.gadget.gadgets.particle.vampire.ParticleBlood; import mineplex.core.gadget.gadgets.particle.wisdom.ParticleEnchant; +import mineplex.core.gadget.gadgets.taunts.BlowAKissTaunt; import mineplex.core.gadget.gadgets.wineffect.WinEffectBabyChicken; import mineplex.core.gadget.gadgets.wineffect.WinEffectFlames; import mineplex.core.gadget.gadgets.wineffect.WinEffectHalloween; import mineplex.core.gadget.gadgets.wineffect.WinEffectLavaTrap; import mineplex.core.gadget.gadgets.wineffect.WinEffectLightningStrike; +import mineplex.core.gadget.gadgets.wineffect.WinEffectLoveIsABattlefield; import mineplex.core.gadget.gadgets.wineffect.WinEffectMrPunchMan; import mineplex.core.gadget.gadgets.wineffect.WinEffectRiseOfTheElderGuardian; import mineplex.core.gadget.gadgets.wineffect.WinEffectSnowTrails; @@ -131,6 +135,7 @@ import mineplex.core.mount.types.MountCart; import mineplex.core.mount.types.MountChicken; import mineplex.core.mount.types.MountFreedomHorse; import mineplex.core.mount.types.MountFrost; +import mineplex.core.mount.types.MountLoveTrain; import mineplex.core.mount.types.MountMule; import mineplex.core.mount.types.MountNightmareSteed; import mineplex.core.mount.types.MountSlime; @@ -152,7 +157,6 @@ import mineplex.core.reward.rewards.RuneAmplifierReward; import mineplex.core.reward.rewards.SpinTicketReward; import mineplex.core.reward.rewards.TreasureShardReward; import mineplex.core.reward.rewards.UnknownPackageReward; -import mineplex.core.stats.StatsManager; import mineplex.core.treasure.TreasureType; public class RewardManager @@ -162,7 +166,6 @@ public class RewardManager private CoreClientManager _clientManager; private DonationManager _donationManager; - private StatsManager _statsManager; private InventoryManager _inventoryManager; private GadgetManager _gadgetManager; private PetManager _petManager; @@ -179,9 +182,9 @@ public class RewardManager private int _legendaryShards = 5000; public RewardManager(CoreClientManager clientManager, DonationManager donationManager, InventoryManager inventoryManager, - PetManager petManager, StatsManager statsManager, GadgetManager gadgetManager) + PetManager petManager, GadgetManager gadgetManager) { - _rewardPools = new EnumMap(RewardPool.Type.class); + _rewardPools = new EnumMap<>(RewardPool.Type.class); _random = new Random(); for (RewardPool.Type type : RewardPool.Type.values()) @@ -191,7 +194,6 @@ public class RewardManager _clientManager = clientManager; _donationManager = donationManager; - _statsManager = statsManager; _inventoryManager = inventoryManager; _gadgetManager = gadgetManager; _petManager = petManager; @@ -237,10 +239,7 @@ public class RewardManager addInventoryReward(Type.VALENTINES_GIFT, getGadget(ItemBow.class), rarity, 300, 0, 1, 5); // INFUSED CHESTS - addInventoryReward(Type.INFUSED_GADGETS, getGadget(ItemCoal.class), rarity, 30, 0, 50, 100); - addInventoryReward(Type.INFUSED_GADGETS, getGadget(ItemFreezeCannon.class), rarity, 45, 0, 5, 10); - addInventoryReward(Type.INFUSED_GADGETS, getGadget(ItemPartyPopper.class), rarity, 60, 0, 5, 10); - addInventoryReward(Type.INFUSED_GADGETS, getGadget(ItemSnowball.class), rarity, 60, 0, 5, 10); + } public void addUncommon() @@ -324,13 +323,7 @@ public class RewardManager addBalloon(Type.NORMAL, BalloonType.BABY_SHEEP, rarity, 15, 100); // INFUSED CHESTS - addHat(Type.INFUSED_CHESTS, HatType.PRESENT, rarity, 40, 100); - addHat(Type.INFUSED_CHESTS, HatType.SNOWMAN, rarity, 38, 100); - addInventoryReward(Type.INFUSED_GADGETS, getGadget(ItemCoal.class), rarity, 33, 0, 65, 200); - addInventoryReward(Type.INFUSED_GADGETS, getGadget(ItemFreezeCannon.class), rarity, 45, 0, 25, 40); - addInventoryReward(Type.INFUSED_GADGETS, getGadget(ItemPartyPopper.class), rarity, 60, 0, 25, 40); - addInventoryReward(Type.INFUSED_GADGETS, getGadget(ItemSnowball.class), rarity, 60, 0, 25, 40); } public void addRare() @@ -519,7 +512,7 @@ public class RewardManager addHat(Type.HAUNTED, HatType.PUMPKIN, rarity, 10); addGadget(Type.HAUNTED, getGadget(ArrowTrailHalloween.class), rarity, 100); - //TRICK OR TREAT + // TRICK OR TREAT addReward(Type.TRICK_OR_TREAT, new SpinTicketReward(_clientManager, 1, 3, rarity, 150, 0)); addReward(Type.TRICK_OR_TREAT, new GameAmplifierReward(_inventoryManager, 1, 2, rarity, 150, 0)); addReward(Type.TRICK_OR_TREAT, new RuneAmplifierReward(_inventoryManager, 20, 1, 3, rarity, 120, 0)); @@ -528,13 +521,12 @@ public class RewardManager addReward(Type.TRICK_OR_TREAT, new ChestReward(_inventoryManager, TreasureType.ANCIENT, 1, 5, rarity, 80, 0)); // INFUSED CHESTS - addGadget(Type.INFUSED_CHESTS, getGadget(ArrowTrailCandyCane.class), rarity, 30, 500); - addGadget(Type.INFUSED_CHESTS, getGadget(DoubleJumpCandyCane.class), rarity, 30, 500); - addGadget(Type.INFUSED_CHESTS, getGadget(DeathCandyCane.class), rarity, 30, 500); - addGadget(Type.INFUSED_CHESTS, getGadget(ParticleCandyCane.class), rarity, 30, 500); - addHat(Type.INFUSED_CHESTS, HatType.SANTA, rarity, 55, 500); + addHat(Type.INFUSED_CHESTS, HatType.COMPANION_BLOCK, rarity, 100); + addHat(Type.INFUSED_CHESTS, HatType.LOVESTRUCK, rarity, 100); + addHat(Type.INFUSED_CHESTS, HatType.SECRET_PACKAGE, rarity, 100); + addHat(Type.INFUSED_CHESTS, HatType.TEDDY_BEAR, rarity, 100); - //THANKFUL + // THANKFUL addReward(Type.THANKFUL, new SpinTicketReward(_clientManager, 1, 3, rarity, 150, 0)); addReward(Type.THANKFUL, new RuneAmplifierReward(_inventoryManager, 20, 1, 3, rarity, 120, 0)); addReward(Type.THANKFUL, new UnknownPackageReward(_donationManager, "Clan Banner Access", "Wear/Place Clan Banner", "Clan Banner Usage", new ItemStack(Material.BANNER), rarity, 110, 0)); @@ -546,6 +538,13 @@ public class RewardManager addGadget(Type.GINGERBREAD, getGadget(OutfitFreezeSuitChestplate.class), rarity, 100); addGadget(Type.GINGERBREAD, getGadget(OutfitFreezeSuitLeggings.class), rarity, 100); addGadget(Type.GINGERBREAD, getGadget(OutfitFreezeSuitBoots.class), rarity, 50); + + // LOVE CHEST + addMount(Type.LOVECHEST, getMount(MountLoveTrain.class), rarity, 30, 500); + + addPetReward(Type.LOVECHEST, PetType.CUPID_PET, rarity, 50, 500); + + addGadget(Type.LOVECHEST, getGadget(WinEffectLoveIsABattlefield.class), rarity, 100, 500); } public void addLegendary() @@ -729,7 +728,7 @@ public class RewardManager addGadget(Type.HAUNTED, getGadget(WinEffectHalloween.class), rarity, 50); addMount(Type.HAUNTED, getMount(MountNightmareSteed.class), rarity, 60); - //TRICK OR TREAT + // TRICK OR TREAT addReward(Type.TRICK_OR_TREAT, new ChestReward(_inventoryManager, TreasureType.MYTHICAL, 1, 3, rarity, 50, 0)); addReward(Type.TRICK_OR_TREAT, new ChestReward(_inventoryManager, TreasureType.ILLUMINATED, 1, 1, rarity, 30, 0)); addMount(Type.TRICK_OR_TREAT, getMount(MountZombie.class), rarity, 25); @@ -738,15 +737,12 @@ public class RewardManager // INFUSED CHESTS - addGadget(Type.INFUSED_CHESTS, getGadget(ArrowTrailFrostLord.class), rarity, 5, 5000); - addMount(Type.INFUSED_CHESTS, getMount(MountBabyReindeer.class), rarity, 10, 5000); - addGadget(Type.INFUSED_CHESTS, getGadget(DeathFrostLord.class), rarity, 35, 5000); - addGadget(Type.INFUSED_CHESTS, getGadget(DoubleJumpFrostLord.class), rarity, 35, 5000); - addGadget(Type.INFUSED_CHESTS, getGadget(MorphSnowman.class), rarity, 35, 5000); - addHat(Type.INFUSED_CHESTS, HatType.GRINCH, rarity, 35, 5000); - addGadget(Type.INFUSED_CHESTS, getGadget(ParticleFrostLord.class), rarity, 35, 500); + addGadget(Type.INFUSED_CHESTS, getGadget(ArrowTrailCupid.class), rarity, 100, 5000); + addGadget(Type.INFUSED_CHESTS, getGadget(DeathCupidsBrokenHeart.class), rarity, 100, 5000); + addGadget(Type.INFUSED_CHESTS, getGadget(ParticleHeart.class), rarity, 100, 5000); + addGadget(Type.INFUSED_CHESTS, getGadget(DoubleJumpCupidsWings.class), rarity, 100, 5000); - //THANKFUL + // THANKFUL addReward(Type.THANKFUL, new ChestReward(_inventoryManager, TreasureType.MYTHICAL, 1, 3, rarity, 50, 0)); addReward(Type.THANKFUL, new ChestReward(_inventoryManager, TreasureType.ILLUMINATED, 1, 1, rarity, 30, 0)); addReward(Type.THANKFUL, new ChestReward(_inventoryManager, TreasureType.ILLUMINATED, 1, 1, rarity, 30, 0)); @@ -760,6 +756,11 @@ public class RewardManager addGadget(Type.GINGERBREAD, getGadget(WinEffectWinterWarfare.class), rarity, 25); addGadget(Type.GINGERBREAD, getGadget(OutfitFreezeSuitHelmet.class), rarity, 1); addPetReward(Type.GINGERBREAD, PetType.GINGERBREAD_MAN, rarity, 10); + + // LOVE CHEST + addGadget(Type.LOVECHEST, getGadget(MorphLoveDoctor.class), rarity, 30, 5000); + addGadget(Type.LOVECHEST, getGadget(BlowAKissTaunt.class), rarity, 50, 5000); + addGadget(Type.LOVECHEST, getGadget(ParticleWingsLove.class), rarity, 10, 5000); } public UnknownPackageReward addMount(Type type, Mount mount, RewardRarity rarity, int weight) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/reward/RewardPool.java b/Plugins/Mineplex.Core/src/mineplex/core/reward/RewardPool.java index 0b046295e..c8a1fc4fc 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/reward/RewardPool.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/reward/RewardPool.java @@ -64,6 +64,7 @@ public class RewardPool THANKFUL(false), GINGERBREAD(false, 1), MINESTRIKE(true, 2), + LOVECHEST(false, 1), CARL_SPINNER(true); private boolean _useDuplicates; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/reward/RewardType.java b/Plugins/Mineplex.Core/src/mineplex/core/reward/RewardType.java index 8c0ed40a0..f235c8dda 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/reward/RewardType.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/reward/RewardType.java @@ -19,6 +19,7 @@ public enum RewardType THANKFUL_CHEST( 0.1, 2, 16, 0), GINGERBREAD_CHEST( 0, 2, 16, 0), MINESTRIKE_CHEST( 0, 2, 16, 0), + LOVE_CHEST( 0, 6, 18, 0), VALENTINES_GIFT( 0, 7, 20, 20), SPINNER_FILLER( 0.1, 1, 4, 20), diff --git a/Plugins/Mineplex.Core/src/mineplex/core/titles/tracks/HolidayCheerTrack.java b/Plugins/Mineplex.Core/src/mineplex/core/titles/tracks/HolidayCheerTrack.java index f581f2308..547a84087 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/titles/tracks/HolidayCheerTrack.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/titles/tracks/HolidayCheerTrack.java @@ -47,6 +47,7 @@ public class HolidayCheerTrack extends Track HOLIDAY_CHESTS.add(TreasureType.THANKFUL); HOLIDAY_CHESTS.add(TreasureType.TRICK_OR_TREAT); HOLIDAY_CHESTS.add(TreasureType.GINGERBREAD); + HOLIDAY_CHESTS.add(TreasureType.LOVE_CHEST); HOLIDAY_SETS.add(SetFreedom.class); HOLIDAY_SETS.add(SetCupidsLove.class); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/titles/tracks/TreasureHunterTrack.java b/Plugins/Mineplex.Core/src/mineplex/core/titles/tracks/TreasureHunterTrack.java index 739c7e67f..24348b954 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/titles/tracks/TreasureHunterTrack.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/titles/tracks/TreasureHunterTrack.java @@ -26,6 +26,7 @@ public class TreasureHunterTrack extends Track POINTS.put(TreasureType.TRICK_OR_TREAT, 25); POINTS.put(TreasureType.THANKFUL, 25); POINTS.put(TreasureType.GINGERBREAD, 25); + POINTS.put(TreasureType.LOVE_CHEST, 25); POINTS.put(TreasureType.OMEGA, 50); POINTS.put(TreasureType.MINESTRIKE, 3); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/treasure/Treasure.java b/Plugins/Mineplex.Core/src/mineplex/core/treasure/Treasure.java index 1b22eb01e..71b04ad99 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/treasure/Treasure.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/treasure/Treasure.java @@ -1,29 +1,54 @@ package mineplex.core.treasure; -import java.util.*; +import java.awt.Color; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Random; +import java.util.Set; import java.util.concurrent.ConcurrentHashMap; -import mineplex.core.blockrestore.BlockRestore; -import mineplex.core.common.Rank; -import mineplex.core.common.util.*; -import mineplex.core.common.util.UtilParticle.ViewDist; -import mineplex.core.common.util.particles.ColoredParticle; -import mineplex.core.common.util.particles.DustSpellColor; -import mineplex.core.hologram.HologramManager; -import mineplex.core.reward.*; -import mineplex.core.status.ServerStatusManager; -import mineplex.core.rankGiveaway.redis.TitanChestGiveawayMessage; -import mineplex.core.treasure.animation.*; import net.minecraft.server.v1_8_R3.BlockPosition; import net.minecraft.server.v1_8_R3.PacketPlayOutBlockAction; + import org.bukkit.Bukkit; -import org.bukkit.Color; import org.bukkit.Effect; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.craftbukkit.v1_8_R3.util.CraftMagicNumbers; import org.bukkit.entity.Player; +import mineplex.core.blockrestore.BlockRestore; +import mineplex.core.common.Rank; +import mineplex.core.common.util.C; +import mineplex.core.common.util.Callback; +import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilParticle.ViewDist; +import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.particles.ColoredParticle; +import mineplex.core.common.util.particles.DustSpellColor; +import mineplex.core.hologram.HologramManager; +import mineplex.core.rankGiveaway.redis.TitanChestGiveawayMessage; +import mineplex.core.reward.RankRewardData; +import mineplex.core.reward.Reward; +import mineplex.core.reward.RewardData; +import mineplex.core.reward.RewardRarity; +import mineplex.core.reward.RewardType; +import mineplex.core.status.ServerStatusManager; +import mineplex.core.treasure.animation.Animation; +import mineplex.core.treasure.animation.BlockChangeAnimation; +import mineplex.core.treasure.animation.ChestOpenAnimation; +import mineplex.core.treasure.animation.ChestSpawnAnimation; +import mineplex.core.treasure.animation.FreedomChestAnimation; +import mineplex.core.treasure.animation.LootLegendaryAnimation; +import mineplex.core.treasure.animation.LootMythicalAnimation; +import mineplex.core.treasure.animation.LootRareAnimation; +import mineplex.core.treasure.animation.LootUncommonAnimation; +import mineplex.core.treasure.animation.TreasureRemoveAnimation; + /** * Created by Shaun on 8/27/2014. */ @@ -184,6 +209,12 @@ public class Treasure block.getLocation().add(.5 + rX, .7, .5 + rZ)); coloredParticle.display(); } + else if (_treasureType == TreasureType.LOVE_CHEST) + { + int r = (int) (Math.random() * 2); + double rX = Math.random() * 2 - 1, rZ = Math.random() * 2 - 1; + UtilParticle.PlayParticle(type, block.getLocation().add(.5 + rX, .7, .5 + rZ), .5f, .5f, .5f, .25f, 1, ViewDist.NORMAL); + } else { UtilParticle.PlayParticle(type, block.getLocation().add(0.5, 0.5, 0.5), 0.5F, 0.5F, 0.5F, 0.2F, 0, diff --git a/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureLocation.java b/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureLocation.java index 40a8775d6..cdef82335 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureLocation.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureLocation.java @@ -138,7 +138,7 @@ public class TreasureLocation implements Listener } if(treasureType == TreasureType.ILLUMINATED || treasureType == TreasureType.FREEDOM || treasureType == TreasureType.OMEGA - || treasureType == TreasureType.HAUNTED || treasureType == TreasureType.GINGERBREAD) + || treasureType == TreasureType.HAUNTED || treasureType == TreasureType.GINGERBREAD || treasureType == TreasureType.LOVE_CHEST) { if(!_treasureManager.hasItemsToGivePlayer(treasureType.getRewardPool(), player)) { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureStyle.java b/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureStyle.java index b2b3a7de2..aab8d9172 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureStyle.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureStyle.java @@ -83,6 +83,13 @@ public enum TreasureStyle ParticleType.INSTANT_SPELL, Sound.EXPLODE, Sound.EXPLODE + ), + LOVECHEST( + ParticleType.HEART, + ParticleType.HEART, + ParticleType.HEART, + Sound.VILLAGER_YES, + Sound.VILLAGER_YES ); private ParticleType _secondaryParticle; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureType.java b/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureType.java index 7d64e93b5..8766e644a 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureType.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureType.java @@ -30,7 +30,9 @@ public enum TreasureType GINGERBREAD(C.cRed + "Gingerbread " + C.cGreen + "Treasure", "Gingerbread Chest", "Gingerbread", RewardType.GINGERBREAD_CHEST, Material.CHEST, TreasureStyle.GINGERBREAD, RewardPool.Type.GINGERBREAD, true, 20000), - MINESTRIKE(C.cGold + "Minestrike Treasure", "Minestrike Chest", "MinestrikeChest", RewardType.MINESTRIKE_CHEST, Material.CHEST, TreasureStyle.MINESTRIKE, RewardPool.Type.MINESTRIKE, true, 10000); + MINESTRIKE(C.cGold + "Minestrike Treasure", "Minestrike Chest", "MinestrikeChest", RewardType.MINESTRIKE_CHEST, Material.CHEST, TreasureStyle.MINESTRIKE, RewardPool.Type.MINESTRIKE, true, 10000), + + LOVE_CHEST(C.cRed + "Love Treasure", "Love Chest", "LoveChest", RewardType.LOVE_CHEST, Material.CHEST, TreasureStyle.LOVECHEST, RewardPool.Type.LOVECHEST, true, 20000); private final String _name; private final RewardType _rewardType; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/treasure/animation/BlockChangeAnimation.java b/Plugins/Mineplex.Core/src/mineplex/core/treasure/animation/BlockChangeAnimation.java index 59b91fcd7..f98716e24 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/treasure/animation/BlockChangeAnimation.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/treasure/animation/BlockChangeAnimation.java @@ -89,6 +89,11 @@ public class BlockChangeAnimation extends Animation mat = Material.STAINED_CLAY; data = 13; } + else if (getTreasure().getTreasureType() == TreasureType.LOVE_CHEST) + { + mat = Material.WOOL; + data = 6; + } else continue; @@ -131,6 +136,11 @@ public class BlockChangeAnimation extends Animation mat = Material.STAINED_CLAY; data = 14; } + else if (getTreasure().getTreasureType() == TreasureType.LOVE_CHEST) + { + mat = Material.WOOL; + data = 14; + } else continue; @@ -213,6 +223,18 @@ public class BlockChangeAnimation extends Animation } } } + else if (getTreasure().getTreasureType() == TreasureType.LOVE_CHEST) + { + for (Block c : _chests) + { + if (c.equals(b)) + { + _blockInfoList.add(new BlockInfo(b)); + b.setType(Material.WOOL); + b.setData((byte) 6); + } + } + } } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/treasure/animation/ChestSpawnAnimation.java b/Plugins/Mineplex.Core/src/mineplex/core/treasure/animation/ChestSpawnAnimation.java index 3ba457213..ce268629c 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/treasure/animation/ChestSpawnAnimation.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/treasure/animation/ChestSpawnAnimation.java @@ -1,11 +1,11 @@ package mineplex.core.treasure.animation; +import java.awt.Color; import java.util.List; import net.minecraft.server.v1_8_R3.BlockPosition; import net.minecraft.server.v1_8_R3.MathHelper; -import org.bukkit.Color; import org.bukkit.Location; import org.bukkit.block.Block; import org.bukkit.craftbukkit.v1_8_R3.CraftWorld; @@ -117,7 +117,7 @@ public class ChestSpawnAnimation extends Animation _particleLocation.add(_particleDirection); //Play Particles - if (getTreasure().getTreasureType() == TreasureType.OLD) + if (getTreasure().getTreasureType() == TreasureType.OLD || getTreasure().getTreasureType() == TreasureType.LOVE_CHEST) { UtilParticle.PlayParticle(getTreasure().getTreasureType().getStyle().getSecondaryParticle(), _centerLocation, 0.1f, 0.1f, 0.1f, 0, 1, ViewDist.NORMAL, UtilServer.getPlayers()); @@ -282,11 +282,16 @@ public class ChestSpawnAnimation extends Animation coloredParticle.display(50); } else if (getTreasure().getTreasureType() != TreasureType.FREEDOM && getTreasure().getTreasureType() != TreasureType.HAUNTED - || getTreasure().getTreasureType() != TreasureType.GINGERBREAD) + && getTreasure().getTreasureType() != TreasureType.GINGERBREAD && getTreasure().getTreasureType() != TreasureType.LOVE_CHEST) { UtilParticle.PlayParticle(particleType, _centerLocation, 0.2f, 0.2f, 0.2f, 0, 50, ViewDist.NORMAL, UtilServer.getPlayers()); } + else if (getTreasure().getTreasureType() == TreasureType.LOVE_CHEST) + { + UtilParticle.PlayParticle(particleType, _centerLocation, 0.2f, 0.2f, 0.2f, 0, 15, + ViewDist.NORMAL, UtilServer.getPlayers()); + } else if (getTreasure().getTreasureType() == TreasureType.FREEDOM) { int r = (int) (Math.random() * 3); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/treasure/gui/BuyChestButton.java b/Plugins/Mineplex.Core/src/mineplex/core/treasure/gui/BuyChestButton.java index f75a6f05b..ef1e9775a 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/treasure/gui/BuyChestButton.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/treasure/gui/BuyChestButton.java @@ -70,6 +70,19 @@ public class BuyChestButton implements IButton player.sendMessage(F.main("Treasure", "That chest is no longer available for purchase!")); return; } + if (_chestType == TreasureType.LOVE_CHEST) + { + if (!new File("../../update/files/EnableLoveChest.dat").exists()) + { + player.sendMessage(F.main("Treasure", "That chest is no longer available for purchase!")); + return; + } + if (!_page.getPlugin().hasItemsToGivePlayer(_chestType.getRewardPool(), player)) + { + player.sendMessage(F.main("Treasure", "You seem to have all treasures for this chest unlocked already!")); + return; + } + } if (_chestType == TreasureType.FREEDOM || _chestType == TreasureType.HAUNTED) { if (!_page.getPlugin().hasItemsToGivePlayer(_chestType.getRewardPool(), player)) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/treasure/gui/TreasurePage.java b/Plugins/Mineplex.Core/src/mineplex/core/treasure/gui/TreasurePage.java index 12e3a69f9..4fda07f6c 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/treasure/gui/TreasurePage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/treasure/gui/TreasurePage.java @@ -1,5 +1,6 @@ package mineplex.core.treasure.gui; +import java.io.File; import java.util.ArrayList; import java.util.List; @@ -135,6 +136,7 @@ public class TreasurePage extends ShopPageBase int thankCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.THANKFUL.getItemName()); int gingerbreadCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.GINGERBREAD.getItemName()); int minestrikeCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.MINESTRIKE.getItemName()); + int loveCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.LOVE_CHEST.getItemName()); boolean availableChristmas = false; boolean availableFreedom = false; @@ -142,6 +144,7 @@ public class TreasurePage extends ShopPageBase boolean availableTrick = false; boolean availableThank = false; boolean availableGingerbread = false; + boolean availableLove = new File("../../update/files/EnableLoveChest.dat").exists(); List shardLore = new ArrayList<>(); shardLore.add(" "); @@ -380,6 +383,30 @@ public class TreasurePage extends ShopPageBase minestrikeLore.add(ChatColor.RESET + "or Purchase at: " + C.cYellow + "www.mineplex.com/shop"); } + List lovechestLore = Lists.newArrayList(); + lovechestLore.add(" "); + lovechestLore.add(F.value("Love Chests Owned", "" + loveCount)); + lovechestLore.add(" "); + lovechestLore.addAll(UtilText.splitLines(new String[]{C.cGray + "Cupid and his hunters have searched far and wide to collect a whole bunch of lovey dovey items. 6 items, no duplicates."}, LineFormat.LORE)); + lovechestLore.add(" "); + if (loveCount > 0) + { + lovechestLore.add(C.cGreen + "Click to Open!"); + } + else + { + if (!availableLove) + { + lovechestLore.add(C.cRed + "This item is no longer available"); + } + else + { + lovechestLore.add(ChatColor.RESET + "Click to craft for " + C.cAqua + TreasureType.LOVE_CHEST.getPurchasePrice() + " Treasure Shards"); + lovechestLore.add(" "); + lovechestLore.add(ChatColor.RESET + "or Purchase at: " + C.cYellow + "www.mineplex.com/shop"); + } + } + ShopItem shards = new ShopItem(Material.PRISMARINE_SHARD, C.cAqua + C.Bold + treasureShards + " Treasure Shards", shardLore.toArray(new String[0]), 0, false); // Normal chests @@ -397,6 +424,7 @@ public class TreasurePage extends ShopPageBase ItemStack trick = new ShopItem(Material.SKULL_ITEM, C.cGoldB + "Trick or Treat Treasure", trickLore.toArray(new String[0]), 0, false, false); ItemStack thank = new ShopItem(Material.COOKED_CHICKEN, C.cGoldB + "Thankful Treasure", thankLore.toArray(new String[0]), 0, false, false); ItemStack gingerbread = SkinData.GINGERBREAD.getSkull(C.cRedB + "Gingerbread" + C.cGreenB + " Treasure", gingerbreadLore); + ItemStack lovechest = new ShopItem(Material.WOOL, (byte) 6, C.cRedB + "Love Chest", lovechestLore.toArray(new String[0]), 0, false, false); // Adds shard item addItem(49, shards); @@ -418,6 +446,7 @@ public class TreasurePage extends ShopPageBase TreasurePageItem trickTreasureItem = new TreasurePageItem(trick, trickCount, TreasureType.TRICK_OR_TREAT); TreasurePageItem thankTreasureItem = new TreasurePageItem(thank, thankCount, TreasureType.THANKFUL); TreasurePageItem gingerbreadTreasureItem = new TreasurePageItem(gingerbread, gingerbreadCount, TreasureType.GINGERBREAD); + TreasurePageItem loveChestItem = new TreasurePageItem(lovechest, loveCount, TreasureType.LOVE_CHEST); _normalTreasures.add(oldTreasureItem); _normalTreasures.add(ancientTreasureItem); @@ -426,7 +455,10 @@ public class TreasurePage extends ShopPageBase _normalTreasures.add(omegaTreasureItem); _normalTreasures.add(minestrikeTreasureItem); - + if (availableLove) + _specialTreasures.add(loveChestItem); + else + _seasonalTreasures.add(loveChestItem); if (availableChristmas) _specialTreasures.add(winterTreasureItem); diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/CustomerSupport.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/CustomerSupport.java index d88087695..41e6239be 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/CustomerSupport.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/CustomerSupport.java @@ -165,6 +165,7 @@ public class CustomerSupport extends MiniPlugin implements ResultSetCallable int thankfulChestsReceived = 0; int gingerbreadChestsReceived = 0; int minestrikeChestsReceived = 0; + int loveChestsReceived = 0; for (CoinTransactionToken transaction : donor.getCoinTransactions()) { @@ -308,6 +309,16 @@ public class CustomerSupport extends MiniPlugin implements ResultSetCallable minestrikeChestsReceived += 1; } } + if (transaction.SalesPackageName.startsWith("Love Chest")) + { + if (transaction.Coins == 0 && transaction.Gems == 0) + { + if (transaction.SalesPackageName.split(" ").length == 3) + loveChestsReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[2]); + else if (transaction.SalesPackageName.split(" ").length == 2) + loveChestsReceived += 1; + } + } if (transaction.SalesPackageName.startsWith("Valentines Gift")) { if (transaction.Coins == 0 && transaction.Gems == 0) @@ -379,6 +390,7 @@ public class CustomerSupport extends MiniPlugin implements ResultSetCallable caller.sendMessage(C.cBlue + "Haunted Chests Received: " + C.cYellow + hauntedChestsReceived + " " + C.cBlue + "Haunted Chests Opened: " + C.cYellow + hauntedChestsOpened); caller.sendMessage(C.cBlue + "Trick or Treat Chests Received: " + C.cYellow + trickOrTreatChestsReceived + " " + C.cBlue + "Thankful Chests Received: " + C.cYellow + thankfulChestsReceived); caller.sendMessage(C.cBlue + "Gingerbread Chests Received: " + C.cYellow + gingerbreadChestsReceived + " " + C.cBlue + "Minestrike Chests Received: " + C.cYellow + minestrikeChestsReceived); + caller.sendMessage(C.cBlue + "Love Chests Received: " + C.cYellow + loveChestsReceived); caller.sendMessage(C.cBlue + "Game Amplifiers Received: " + C.cYellow + boostersReceived); caller.sendMessage(C.cBlue + "Rune Amplifiers (20 min/60 min) Received: " + C.cYellow + runeAmplifier20 + "/" + runeAmplifier60); caller.sendMessage(C.cBlue + "Clan Banner Usage: " + getLockedFreedomStr(client.getUniqueId(), "Clan Banner Usage") + " " + C.cBlue + "Clan Banner Editor: " + getLockedFreedomStr(client.getUniqueId(), "Clan Banner Editor")); diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/SalesPackageManager.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/SalesPackageManager.java index 83fd2cbb4..a8ac55cf0 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/SalesPackageManager.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/SalesPackageManager.java @@ -30,6 +30,7 @@ import mineplex.staffServer.salespackage.salespackages.LifetimeHero; import mineplex.staffServer.salespackage.salespackages.LifetimeLegend; import mineplex.staffServer.salespackage.salespackages.LifetimeTitan; import mineplex.staffServer.salespackage.salespackages.LifetimeUltra; +import mineplex.staffServer.salespackage.salespackages.LoveChest; import mineplex.staffServer.salespackage.salespackages.MinestrikeChest; import mineplex.staffServer.salespackage.salespackages.MythicalChest; import mineplex.staffServer.salespackage.salespackages.OldChest; @@ -98,6 +99,7 @@ public class SalesPackageManager extends MiniPlugin AddSalesPackage(new OmegaChest(this)); AddSalesPackage(new HauntedChest(this)); AddSalesPackage(new MinestrikeChest(this)); + AddSalesPackage(new LoveChest(this)); AddSalesPackage(new TrickOrTreatChest(this)); AddSalesPackage(new ThankfulChest(this)); @@ -169,7 +171,7 @@ public class SalesPackageManager extends MiniPlugin coinBuilder = coinBuilder.extra("[").color("gray").extra(salesPackage.getName()).color("green").click("run_command", "/display " + playerName + " " + salesPackage.getName()).extra("] ").color("gray"); } else if (salesPackage instanceof MythicalChest || salesPackage instanceof AncientChest || salesPackage instanceof OldChest || salesPackage instanceof IlluminatedChest || salesPackage instanceof FreedomChest || salesPackage instanceof HauntedChest || salesPackage instanceof TrickOrTreatChest - || salesPackage instanceof ThankfulChest || salesPackage instanceof GingerbreadChest || salesPackage instanceof MinestrikeChest) + || salesPackage instanceof ThankfulChest || salesPackage instanceof GingerbreadChest || salesPackage instanceof MinestrikeChest || salesPackage instanceof LoveChest) { chestBuilder = chestBuilder.extra("[").color("gray").extra(salesPackage.getName()).color("green").click("run_command", "/display " + playerName + " " + salesPackage.getName()).extra("] ").color("gray"); } diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/LoveChest.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/LoveChest.java new file mode 100644 index 000000000..f30b159bf --- /dev/null +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/LoveChest.java @@ -0,0 +1,20 @@ +package mineplex.staffServer.salespackage.salespackages; + +import org.bukkit.entity.Player; + +import mineplex.staffServer.salespackage.SalesPackageManager; + +public class LoveChest extends SalesPackageBase +{ + public LoveChest(SalesPackageManager manager) + { + super(manager, "1 Love Chest"); + } + + public void displayToAgent(Player agent, String playerName) + { + addButton(agent, "/sales item " + playerName + " 1 Item Love Chest", "Give 1 Love Chest."); + agent.sendMessage(" "); + addBackButton(agent, playerName); + } +} diff --git a/Plugins/mavericks-review-hub/src/mineplex/mavericks/review/Hub.java b/Plugins/mavericks-review-hub/src/mineplex/mavericks/review/Hub.java index e510bd169..e36c7cfea 100644 --- a/Plugins/mavericks-review-hub/src/mineplex/mavericks/review/Hub.java +++ b/Plugins/mavericks-review-hub/src/mineplex/mavericks/review/Hub.java @@ -1,9 +1,11 @@ package mineplex.mavericks.review; +import net.minecraft.server.v1_8_R3.MinecraftServer; + import org.bukkit.Bukkit; import org.bukkit.plugin.java.JavaPlugin; +import org.spigotmc.SpigotConfig; -import mineplex.core.common.Constants; import mineplex.core.CustomTagFix; import mineplex.core.FoodDupeFix; import mineplex.core.PacketsInteractionFix; @@ -14,6 +16,7 @@ import mineplex.core.blockrestore.BlockRestore; import mineplex.core.boosters.BoosterManager; import mineplex.core.chat.Chat; import mineplex.core.command.CommandCenter; +import mineplex.core.common.Constants; import mineplex.core.cosmetic.CosmeticManager; import mineplex.core.creature.Creature; import mineplex.core.disguise.DisguiseManager; @@ -51,8 +54,6 @@ import mineplex.core.updater.FileUpdater; import mineplex.core.updater.Updater; import mineplex.core.velocity.VelocityFix; import mineplex.core.visibility.VisibilityManager; -import net.minecraft.server.v1_8_R3.MinecraftServer; -import org.spigotmc.SpigotConfig; import static mineplex.core.Managers.require; @@ -131,7 +132,7 @@ public class Hub extends JavaPlugin preferenceManager, disguiseManager, blockRestore, projectileManager, achievementManager, packetHandler, hologramManager, incognito); ThankManager thankManager = new ThankManager(this, _clientManager, _donationManager); BoosterManager boosterManager = new BoosterManager(this, serverConfiguration.getServerGroup().getBoosterGroup(), _clientManager, _donationManager, inventoryManager, thankManager); - RewardManager rewardManager = new RewardManager(_clientManager, _donationManager, inventoryManager, petManager, statsManager, gadgetManager); + RewardManager rewardManager = new RewardManager(_clientManager, _donationManager, inventoryManager, petManager, gadgetManager); TreasureManager treasureManager = new TreasureManager(this, _clientManager, serverStatusManager, _donationManager, inventoryManager, petManager, gadgetManager, blockRestore, hologramManager, statsManager, rewardManager); CosmeticManager cosmeticManager = new CosmeticManager(this, _clientManager, _donationManager, inventoryManager, gadgetManager, mountManager, petManager, treasureManager, boosterManager);