This commit is contained in:
xGamingDudex 2016-01-16 14:43:14 +01:00
parent f8e8669b5c
commit 8ee485e44c
10 changed files with 90 additions and 177 deletions

View File

@ -144,7 +144,7 @@ public class Menu extends ShopPageBase<CosmeticManager, CosmeticShop>
type = GadgetType.ArrowTrail;
lore = getLore(ownedCount.get(type), maxCount.get(type), enabled.get(type));
addButton(arrowSlot, new ShopItem(Material.ARROW, "Arrow Trails", lore, 1, false), new OpenArrowTrails(this));
addButton(arrowSlot, new ShopItem(Material.ARROW, "Arrow Effects", lore, 1, false), new OpenArrowTrails(this));
if (enabled.containsKey(type)) addGlow(arrowSlot);
type = GadgetType.DoubleJump;

View File

@ -181,7 +181,6 @@ public class GadgetManager extends MiniPlugin
addGadget(new ParticleRain(this));
addGadget(new ParticleHelix(this));
addGadget(new ParticleGreen(this));
addGadget(new ParticleHeart(this));
addGadget(new ParticleFairy(this));
addGadget(new ParticleLegend(this));
addGadget(new ParticleFrostLord(this));
@ -189,7 +188,8 @@ public class GadgetManager extends MiniPlugin
addGadget(new ParticleCandyCane(this));
addGadget(new ParticleCoalFumes(this));
addGadget(new ParticlePartyTime(this));
addGadget(new ParticleIHeartYou(this));
addGadget(new ParticleHeart(this));
addGadget(new ParticleDemonsWings(this));
// Arrow Trails
addGadget(new ArrowTrailFrostLord(this));

View File

@ -2,14 +2,13 @@ package mineplex.core.gadget.gadgets.particle;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
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.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.common.util.UtilText;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.types.ParticleGadget;
import mineplex.core.updater.UpdateType;
@ -30,9 +29,17 @@ public class ParticleCoalFumes extends ParticleGadget
{
if(event.getType() != UpdateType.TICK) return;
float xz = 2;
float xz = 1;
int amount = 5;
ParticleType type = ParticleType.LARGE_SMOKE;
if(Manager.isMoving(player))
{
xz = 0.4f;
amount = 2;
}
UtilParticle.PlayParticleToAll(ParticleType.LARGE_SMOKE, player.getLocation(), xz, 0, xz, 0, 5, ViewDist.NORMAL);
UtilParticle.PlayParticleToAll(type, player.getLocation(), xz, 0, xz, 0, amount, ViewDist.NORMAL);
}
}

View File

@ -0,0 +1,46 @@
package mineplex.core.gadget.gadgets.particle;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.Player;
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.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.common.util.UtilText;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.types.ParticleGadget;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
public class ParticleDemonsWings extends ParticleGadget
{
private ShapeWings _wings = new ShapeWings(ParticleType.RED_DUST.particleName, null, 0, 0);
public ParticleDemonsWings(GadgetManager manager)
{
super(manager, "Demon Wings", UtilText.splitLineToArray(C.cGray + "Even the shadows can't hide you from the demons", LineFormat.LORE), 1,
Material.COAL, (byte) 1);
}
@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.FASTEST)
UtilParticle.PlayParticleToAll(ParticleType.RED_DUST, loc, 0.3f, 0.3f, 0.3f, 0, 10, ViewDist.NORMAL);
return;
}
if (event.getType() == UpdateType.FAST) _wings.display(loc);
}
}

View File

@ -1,8 +1,6 @@
package mineplex.core.gadget.gadgets.particle;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map.Entry;
import org.bukkit.Location;
import org.bukkit.Material;
@ -13,17 +11,13 @@ import org.bukkit.event.player.PlayerQuitEvent;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilMath;
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.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilText;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.types.ParticleGadget;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
@ -33,9 +27,9 @@ public class ParticleHeart extends ParticleGadget
public ParticleHeart(GadgetManager manager)
{
super(manager, "I Heart You",
super(manager, "Cupids Love",
UtilText.splitLineToArray(C.cGray + "Show off how much you love Mineplex and everyone on it!", LineFormat.LORE), -2,
Material.APPLE, (byte) 0);
Material.APPLE, (byte) 0, "I Heart You");
}
@Override
@ -43,46 +37,15 @@ public class ParticleHeart extends ParticleGadget
{
if (event.getType() != UpdateType.FASTEST) return;
if (!_target.containsKey(player)) _target.put(player, new HashMap<Player, Location>());
if (Recharge.Instance.use(player, GetName(), 500, false, false))
if (Manager.isMoving(player))
{
for (Player other : UtilServer.getPlayers())
{
if (other.equals(player)) continue;
if (!UtilPlayer.isSpectator(other)) continue;
if (_target.get(player).containsKey(other)) continue;
if (UtilMath.offset(player, other) > 6) continue;
_target.get(player).put(other, player.getLocation().add(0, 1, 0));
break;
}
if(getSet() == null || !getSet().isActive(player)) return;
UtilParticle.PlayParticleToAll(ParticleType.HEART, player.getLocation().add(0, 1, 0), null, 0, 1, ViewDist.NORMAL);
}
if (Manager.isMoving(player)) UtilParticle.PlayParticle(ParticleType.HEART, player.getLocation().add(0, 1, 0), 0f, 0f, 0f, 0, 1,
ViewDist.NORMAL, UtilServer.getPlayers());
else UtilParticle.PlayParticle(ParticleType.HEART, player.getLocation().add(0, 1, 0), 0.5f, 0.5f, 0.5f, 0, 1, ViewDist.NORMAL,
UtilServer.getPlayers());
// Particle
for (HashMap<Player, Location> heart : _target.values())
else
{
Iterator<Entry<Player, Location>> heartIterator = heart.entrySet().iterator();
while (heartIterator.hasNext())
{
Entry<Player, Location> entry = heartIterator.next();
entry.getValue().add(UtilAlg.getTrajectory(entry.getValue(), entry.getKey().getEyeLocation()).multiply(0.6));
UtilParticle.PlayParticle(ParticleType.HEART, entry.getValue(), 0, 0, 0, 0, 1, ViewDist.NORMAL, UtilServer.getPlayers());
if (UtilMath.offset(entry.getValue(), entry.getKey().getEyeLocation()) < 0.6) heartIterator.remove();
}
UtilParticle.PlayParticleToAll(ParticleType.HEART, player.getLocation().add(0, 1, 0), 0.5f, 0.5f, 0.5f, 0, 1, ViewDist.NORMAL);
}
}
@ -90,21 +53,14 @@ public class ParticleHeart extends ParticleGadget
public void DisableCustom(Player player)
{
if (_active.remove(player)) UtilPlayer.message(player, F.main("Gadget", "You unsummoned " + F.elem(GetName()) + "."));
clean(player);
}
@EventHandler
public void quit(PlayerQuitEvent event)
{
clean(event.getPlayer());
}
private void clean(Player player)
{
_target.remove(player);
for (HashMap<Player, Location> map : _target.values())
map.remove(player);
}
}

View File

@ -10,7 +10,6 @@ import mineplex.core.common.util.LineFormat;
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.UtilServer;
import mineplex.core.common.util.UtilText;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.types.ParticleGadget;
@ -33,8 +32,7 @@ public class ParticleHelix extends ParticleGadget
if (Manager.isMoving(player))
{
UtilParticle.PlayParticle(ParticleType.RED_DUST, player.getLocation().add(0, 1, 0), 0.2f, 0.2f, 0.2f, 0, 4, ViewDist.NORMAL,
UtilServer.getPlayers());
UtilParticle.PlayParticleToAll(ParticleType.RED_DUST, player.getLocation().add(0, 1, 0), 0.2f, 0.2f, 0.2f, 0, 2, ViewDist.NORMAL);
}
else
{

View File

@ -1,101 +0,0 @@
package mineplex.core.gadget.gadgets.particle;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.block.Block;
import org.bukkit.entity.ArmorStand;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
import mineplex.core.common.shape.ShapeWings;
import mineplex.core.common.util.LineFormat;
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.UtilPlayer;
import mineplex.core.common.util.UtilText;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.types.ParticleGadget;
import mineplex.core.projectile.IThrown;
import mineplex.core.projectile.ProjectileUser;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
public class ParticleIHeartYou extends ParticleGadget implements IThrown
{
private ShapeWings _wings = new ShapeWings();
public ParticleIHeartYou(GadgetManager manager)
{
super(manager, "I ❤ You!",
UtilText.splitLineToArray("Lots and lots of love. I mean, why not ❤", LineFormat.LORE),
1, Material.APPLE, (byte)0);
}
@Override
public void playParticle(Player player, UpdateEvent event)
{
if(event.getType() == UpdateType.SEC)
{
ArmorStand stand = player.getWorld().spawn(player.getLocation().add(0, 1000, 0), ArmorStand.class);
stand.setSmall(true);
stand.setVisible(false);
stand.teleport(player.getEyeLocation().add(0, 0.3, 0));
stand.setFallDistance(-1000000);
Manager.getProjectileManager().AddThrow(stand, player, this, 2000, true, false, false, false, null, 0, 0, ParticleType.HEART, UpdateType.TICK, 0);
Vector v = null;
Player closest = UtilPlayer.getClosest(player.getLocation(), player);
if(closest != null && closest.getLocation().distanceSquared(player.getLocation()) > 12*12)
{
v = closest.getLocation().subtract(player.getLocation()).toVector().normalize();
v.setY(v.getY()+0.5);
}
else
{
v = Vector.getRandom().subtract(Vector.getRandom()).setY(0).normalize().multiply(0.3).setY(0.5);
}
stand.setVelocity(v);
}
if(getSet() != null && getSet().isActive(player))
{
Location loc = player.getLocation().add(0, 1.2, 0).add(player.getLocation().getDirection().multiply(-0.2));
if(Manager.isMoving(player))
{
if(event.getType() == UpdateType.FASTEST)
UtilParticle.PlayParticleToAll(ParticleType.RED_DUST, loc, 0.3f, 0.3f, 0.3f, 0, 10, ViewDist.NORMAL);
return;
}
if(event.getType() == UpdateType.FAST) _wings.display(loc);
}
}
@Override
public void Collide(LivingEntity target, Block block, ProjectileUser data)
{
if(target.getType() == EntityType.PLAYER)
{
UtilParticle.PlayParticleToAll(ParticleType.HEART, data.GetThrown().getLocation(), 0.2f, 0.2f, 0.2f, 0, 10, ViewDist.NORMAL);
target.getWorld().playSound(data.GetThrown().getLocation(), Sound.CHICKEN_EGG_POP, 0.5f, 1f);
}
}
@Override
public void Idle(ProjectileUser data)
{
}
@Override
public void Expire(ProjectileUser data)
{
}
}

View File

@ -59,8 +59,12 @@ public class ParticlePartyTime extends ParticleGadget
for(int i = 0; i < 1; i++)
{
String particle = ParticleType.ICON_CRACK.getParticle(Material.INK_SACK, list.get(i));
UtilParticle.PlayParticleToAll(particle, loc, null, 0.08f, 10, ViewDist.NORMAL);
// loc.getWorld().playSound(loc, Sound.FIREWORK_BLAST, 0.03f, 1.4f);
if(Manager.isMoving(player)) {
UtilParticle.PlayParticleToAll(particle, player.getLocation().add(0, 1, 0), null, 0.08f, 1, ViewDist.NORMAL);
} else {
UtilParticle.PlayParticleToAll(particle, loc, null, 0.08f, 10, ViewDist.NORMAL);
}
}
if(getSet() != null && getSet().isActive(player))

View File

@ -1,5 +1,9 @@
package mineplex.core.gadget.gadgets.particle;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
@ -33,19 +37,19 @@ public class ParticleRain extends ParticleGadget
if (Manager.isMoving(player))
{
UtilParticle.PlayParticle(ParticleType.SPLASH, player.getLocation().add(0, 1, 0), 0.2f, 0.2f, 0.2f, 0, 4, ViewDist.NORMAL,
UtilServer.getPlayers());
UtilParticle.PlayParticleToAll(ParticleType.SPLASH, player.getLocation(), 0.2f, 0, 0.2f, 0, 6, ViewDist.NORMAL);
}
else
{
UtilParticle.PlayParticle(ParticleType.EXPLODE, player.getLocation().add(0, 3.5, 0), 0.6f, 0f, 0.6f, 0, 8, ViewDist.NORMAL, player);
Location loc = player.getLocation().add(0, 3.5, 0);
UtilParticle.PlayParticle(ParticleType.EXPLODE, loc, 0.6f, 0f, 0.6f, 0, 8, ViewDist.NORMAL, player);
for (Player other : UtilServer.getPlayers())
if (!player.equals(other)) UtilParticle.PlayParticle(ParticleType.CLOUD, player.getLocation().add(0, 3.5, 0), 0.6f, 0.1f, 0.6f, 0,
8, ViewDist.NORMAL, other);
List<Player> others = new ArrayList<Player>();
others.addAll(UtilServer.getPlayersCollection());
others.remove(player);
UtilParticle.PlayParticle(ParticleType.CLOUD, loc, 0.6f, 0.1f, 0.6f, 0, 8, ViewDist.NORMAL);
UtilParticle.PlayParticle(ParticleType.DRIP_WATER, player.getLocation().add(0, 3.5, 0), 0.4f, 0.1f, 0.4f, 0, 2, ViewDist.NORMAL,
UtilServer.getPlayers());
UtilParticle.PlayParticleToAll(ParticleType.DRIP_WATER, loc, 0.4f, 0.1f, 0.4f, 0, 2, ViewDist.NORMAL);
// Sound
player.getWorld().playSound(player.getLocation(), Sound.AMBIENCE_RAIN, 0.1f, 1f);

View File

@ -4,7 +4,7 @@ import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailCupid;
import mineplex.core.gadget.gadgets.death.DeathCupidsBorkenHeart;
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpCupidsWings;
import mineplex.core.gadget.gadgets.particle.ParticleIHeartYou;
import mineplex.core.gadget.gadgets.particle.ParticleHeart;
import mineplex.core.gadget.types.GadgetSet;
public class SetCupidsWings extends GadgetSet
@ -12,12 +12,11 @@ public class SetCupidsWings extends GadgetSet
public SetCupidsWings(GadgetManager manager)
{
super(manager, "Cupid's Wings", "Get wings when standing still",
super(manager, "Cupid's Love", "Spread the love even when you move!",
manager.getGadget(ArrowTrailCupid.class),
manager.getGadget(DeathCupidsBorkenHeart.class),
manager.getGadget(DoubleJumpCupidsWings.class),
manager.getGadget(ParticleIHeartYou.class),
manager.getGadget(ArrowTrailCupid.class));
manager.getGadget(ParticleHeart.class));
}
}