Merge branch 'update/cosmetics-valentines' into develop

This commit is contained in:
cnr 2017-02-08 22:32:35 -06:00
commit 181f360f11
53 changed files with 1149 additions and 123 deletions

View File

@ -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,18 +207,39 @@ 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);
}
}

View File

@ -63,6 +63,7 @@ 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

View File

@ -1,6 +1,6 @@
package mineplex.core.common.util.particles;
import org.bukkit.Color;
import java.awt.Color;
public class DustSpellColor extends ParticleColor
{

View File

@ -152,7 +152,7 @@ public class BonusManager extends MiniClientPlugin<BonusClientData> 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;

View File

@ -170,6 +170,11 @@ public class GadgetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
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)

View File

@ -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())
{

View File

@ -22,7 +22,7 @@ public class UnlockCosmeticsCommand extends CommandBase<GadgetManager>
public UnlockCosmeticsCommand(GadgetManager plugin)
{
super(plugin, Rank.JNR_DEV, "unlockCosmetics");
super(plugin, Rank.SNR_MODERATOR, "unlockCosmetics");
_plugin = plugin;
}

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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<Material> ignore = new HashSet<Material>();
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();
}
}

View File

@ -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);
}
}
}

View File

@ -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<Material> 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)
{
}
}

View File

@ -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)
{

View File

@ -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;

View File

@ -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<ArmorStand> _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<Location> 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++;
}
}
}

View File

@ -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; }

View File

@ -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);

View File

@ -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);
}
}

View File

@ -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));
}

View File

@ -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<Horse> 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<Horse> 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<Horse> 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);
}
}
}
}

View File

@ -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
{

View File

@ -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;

View File

@ -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;
}
}

View File

@ -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();

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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<Player, Double> 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();
}
}
}

View File

@ -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);
}
}

View File

@ -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;

View File

@ -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;

View File

@ -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<PetClient>
private Map<Creature, FlyingPetManager> _flyingPets = new HashMap<>();
private Map<Creature, TrueLoveData> _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<PetClient>
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<PetClient>
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,23 +499,53 @@ public class PetManager extends MiniClientPlugin<PetClient>
@EventHandler
public void onUpdate(UpdateEvent event)
{
for(Creature pet : _activePetOwners.values())
{
if(pet instanceof PigZombie && 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())
{
((CraftPigZombie)pet).getHandle().setSilent(true);
}
}
if (pet instanceof Blaze && event.getType() == UpdateType.FAST)
{
Location loc = pet.getLocation().clone().add(0, .5, 0).add(pet.getLocation().getDirection().multiply(-0.2));
if (event.getType() == UpdateType.FAST) _wings.display(loc);
if (event.getType() == UpdateType.FAST) _wingsEdge.display(loc);
for (Entry<String, Creature> entry : _activePetOwners.entrySet())
{
String playerName = entry.getKey();
Creature creature = entry.getValue();
if (event.getType() == UpdateType.TICK)
{
if (creature instanceof PigZombie)
{
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);
}
}
}
else if (event.getType() == UpdateType.FAST)
{
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));
_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);
}
}
}

View File

@ -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

View File

@ -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, RewardPool>(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)

View File

@ -64,6 +64,7 @@ public class RewardPool
THANKFUL(false),
GINGERBREAD(false, 1),
MINESTRIKE(true, 2),
LOVECHEST(false, 1),
CARL_SPINNER(true);
private boolean _useDuplicates;

View File

@ -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),

View File

@ -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);

View File

@ -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);
}

View File

@ -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,

View File

@ -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))
{

View File

@ -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;

View File

@ -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;

View File

@ -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);
}
}
}
}
}

View File

@ -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);

View File

@ -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))

View File

@ -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<TreasureManager, TreasureShop>
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<TreasureManager, TreasureShop>
boolean availableTrick = false;
boolean availableThank = false;
boolean availableGingerbread = false;
boolean availableLove = new File("../../update/files/EnableLoveChest.dat").exists();
List<String> shardLore = new ArrayList<>();
shardLore.add(" ");
@ -380,6 +383,30 @@ public class TreasurePage extends ShopPageBase<TreasureManager, TreasureShop>
minestrikeLore.add(ChatColor.RESET + "or Purchase at: " + C.cYellow + "www.mineplex.com/shop");
}
List<String> 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<TreasureManager, TreasureShop>
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<TreasureManager, TreasureShop>
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<TreasureManager, TreasureShop>
_normalTreasures.add(omegaTreasureItem);
_normalTreasures.add(minestrikeTreasureItem);
if (availableLove)
_specialTreasures.add(loveChestItem);
else
_seasonalTreasures.add(loveChestItem);
if (availableChristmas)
_specialTreasures.add(winterTreasureItem);

View File

@ -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"));

View File

@ -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");
}

View File

@ -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);
}
}

View File

@ -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);