Add new cosmetic items
This commit is contained in:
parent
3c929a4b00
commit
3d430dedf6
@ -166,7 +166,40 @@ public class ShapeWings extends ShapeGrid implements CosmeticShape
|
||||
"0$#######$0",
|
||||
"$#########$"
|
||||
};
|
||||
|
||||
|
||||
public static final String[] MAPLE_LEAF = new String[]
|
||||
{
|
||||
"000000000000000000000000000$000000000000000000000000000",
|
||||
"00000000000000000000000000$$$00000000000000000000000000",
|
||||
"0000000000000000000000000$$#$$0000000000000000000000000",
|
||||
"000000000000000000000000$$###$$000000000000000000000000",
|
||||
"00000000000000000000000$$#####$$00000000000000000000000",
|
||||
"0000000000000000$$$000$$#######$$000$$$0000000000000000",
|
||||
"0000000000000000$#$$$$$#########$$$$$#$0000000000000000",
|
||||
"0000000000000000$$###################$$0000000000000000",
|
||||
"00000000000000000$###################$00000000000000000",
|
||||
"00000000000$$0000$$#################$$0000$$00000000000",
|
||||
"0$$$000000$$$$$000$#################$000$$$$$000000$$$0",
|
||||
"00$$$$$$$$$###$$$0$$###############$$0$$$###$$$$$$$$$00",
|
||||
"00$$############$$$$###############$$$$############$$00",
|
||||
"000$$#############$$###############$$#############$$000",
|
||||
"0000$$###########################################$$0000",
|
||||
"00$$$#############################################$$$00",
|
||||
"$$$#################################################$$$",
|
||||
"00$$$$###########################################$$$$00",
|
||||
"00000$$$#######################################$$$00000",
|
||||
"00000000$$$$###############################$$$$00000000",
|
||||
"00000000000$$$###########################$$$00000000000",
|
||||
"0000000000000$$#########################$$0000000000000",
|
||||
"0000000000000$$#########################$$0000000000000",
|
||||
"0000000000000$##$$$$$$$$$$$#$$$$$$$$$$$##$0000000000000",
|
||||
"000000000000$$$$$000000000$#$000000000$$$$$000000000000",
|
||||
"00000000000000000000000000$#$00000000000000000000000000",
|
||||
"00000000000000000000000000$#$00000000000000000000000000",
|
||||
"00000000000000000000000000$#$00000000000000000000000000",
|
||||
"00000000000000000000000000$#$00000000000000000000000000",
|
||||
"00000000000000000000000000$$$00000000000000000000000000"
|
||||
};
|
||||
|
||||
/**
|
||||
* Default rotation to give the wings a little tilt when displayed on players for instance
|
||||
|
@ -0,0 +1,78 @@
|
||||
package mineplex.core.gadget.gadgets.arrowtrail;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.LineFormat;
|
||||
import mineplex.core.common.util.UtilAlg;
|
||||
import mineplex.core.common.util.UtilParticle;
|
||||
import mineplex.core.common.util.UtilText;
|
||||
import mineplex.core.common.util.banner.CountryFlag;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
import mineplex.core.gadget.types.ArrowEffectGadget;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.banner.Pattern;
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.BannerMeta;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
public class ArrowTrailRedWhite extends ArrowEffectGadget
|
||||
{
|
||||
public ArrowTrailRedWhite(GadgetManager manager)
|
||||
{
|
||||
super(manager, "Red & White Arrows",
|
||||
UtilText.splitLineToArray(C.cRed + "Killing you nicely.", LineFormat.LORE),
|
||||
-8, Material.WOOL, (byte)0);
|
||||
|
||||
setDisplayItem(CountryFlag.CANADA.getBanner());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doTrail(Arrow arrow)
|
||||
{
|
||||
Vector v = arrow.getVelocity();
|
||||
Vector up = UtilAlg.getUp(v);
|
||||
Vector left = UtilAlg.getLeft(v);
|
||||
|
||||
Location loc = arrow.getLocation();
|
||||
|
||||
double amount = 2;
|
||||
double ticks = 15;
|
||||
|
||||
for(int i = 0; i < amount; i++)
|
||||
{
|
||||
double rad = Math.PI*2.0;
|
||||
rad += i/amount * rad;
|
||||
rad += Math.PI*2*(arrow.getTicksLived()%ticks)/ticks;
|
||||
double l = -Math.sin(rad);
|
||||
double u = Math.cos(rad);
|
||||
|
||||
Vector vel = v.clone().add(up.clone().multiply(u)).add(left.clone().multiply(l));
|
||||
vel.multiply(0.4);
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
for(int j = 0; j < 3; ++j)
|
||||
{
|
||||
UtilParticle.playColoredParticleToAll(Color.RED, UtilParticle.ParticleType.RED_DUST, loc.clone().add(vel), 0, UtilParticle.ViewDist.NORMAL);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for(int j = 0; j < 3; ++j)
|
||||
{
|
||||
UtilParticle.playColoredParticleToAll(Color.WHITE, UtilParticle.ParticleType.RED_DUST, loc.clone().add(vel), 0, UtilParticle.ViewDist.NORMAL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doHitEffect(Arrow arrow)
|
||||
{
|
||||
//UtilParticle.PlayParticleToAll(UtilParticle.ParticleType.EXPLODE, arrow.getLocation(), 0.35f, 0.35f, 0.35f, 1f, 15, UtilParticle.ViewDist.LONGER);
|
||||
UtilParticle.PlayParticleToAll(UtilParticle.ParticleType.EXPLODE, arrow.getLocation(), 0, 0, 0, 0, 3, UtilParticle.ViewDist.LONGER);
|
||||
}
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package mineplex.core.gadget.gadgets.death;
|
||||
|
||||
import mineplex.core.blood.BloodEvent;
|
||||
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.UtilShapes;
|
||||
import mineplex.core.common.util.UtilText;
|
||||
import mineplex.core.common.util.banner.CountryFlag;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
import mineplex.core.gadget.types.DeathEffectGadget;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
/**
|
||||
* @author J Teissler
|
||||
* @date 6/26/17
|
||||
*/
|
||||
public class DeathMapleLeaf extends DeathEffectGadget
|
||||
{
|
||||
private final ShapeWings _leafOuter = new ShapeWings(UtilParticle.ParticleType.RED_DUST.particleName, new Vector(1.0, 0, 0), 1, 0, false, 0, ShapeWings.MAPLE_LEAF);
|
||||
private final ShapeWings _leafInner = new ShapeWings(UtilParticle.ParticleType.RED_DUST.particleName, new Vector(0.7, 0, 0), 1, 0, false, 0, ShapeWings.MAPLE_LEAF);
|
||||
|
||||
public DeathMapleLeaf(GadgetManager manager)
|
||||
{
|
||||
super(manager, "Fallen Maple Leaf",
|
||||
UtilText.splitLineToArray(C.cGray + "When you die in " + C.cRed + "Canada" + C.cGray + " you die in real life.", LineFormat.LORE),
|
||||
-8, Material.WOOL, (byte) 0);
|
||||
|
||||
setDisplayItem(CountryFlag.CANADA.getBanner());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlood(Player player, BloodEvent event)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
Location loc = player.getLocation().add(0, 3, 0);
|
||||
_leafOuter.display(loc);
|
||||
_leafInner.display(loc);
|
||||
}
|
||||
}
|
@ -0,0 +1,114 @@
|
||||
package mineplex.core.gadget.gadgets.doublejump;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.LineFormat;
|
||||
import mineplex.core.common.util.UtilAlg;
|
||||
import mineplex.core.common.util.UtilColor;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilParticle;
|
||||
import mineplex.core.common.util.UtilText;
|
||||
import mineplex.core.common.util.banner.CountryFlag;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
import mineplex.core.gadget.types.DoubleJumpEffectGadget;
|
||||
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.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
public class DoubleJumpMaple extends DoubleJumpEffectGadget
|
||||
{
|
||||
/**
|
||||
* Amount of particles played per tick as a player flies through the air.
|
||||
*/
|
||||
private static final int PARTICLES = 50;
|
||||
|
||||
/**
|
||||
* Vertical offset of the animation's center from the player's location.
|
||||
*/
|
||||
private static final float Y_OFFSET = 0.95f;
|
||||
|
||||
/**
|
||||
* Divisor of the gaussian distribution of particles as the player flies through the air.
|
||||
*/
|
||||
private static final int DISTRIBUTION = 2;
|
||||
|
||||
/**
|
||||
* Particle ring count when a player launches from the ground.
|
||||
*/
|
||||
private static final int LAUNCH_RINGS = 6;
|
||||
|
||||
/**
|
||||
* The distance between launch rings.
|
||||
*/
|
||||
private static final float RING_SPACING = 0.4f;
|
||||
|
||||
/**
|
||||
* Particles played per 1 unit radius.
|
||||
*/
|
||||
private static final int RING_DENSITY = 8;
|
||||
|
||||
private HashMap<Player, Long> _playerMap = new HashMap<>();
|
||||
|
||||
public DoubleJumpMaple(GadgetManager manager)
|
||||
{
|
||||
super(manager, "Maple Leap",
|
||||
UtilText.splitLineToArray(C.cGray + "Jump higher than the maple trees!", LineFormat.LORE),
|
||||
-8, Material.WOOL, (byte)0);
|
||||
setDisplayItem(CountryFlag.CANADA.getBanner());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doEffect(Player player)
|
||||
{
|
||||
_playerMap.put(player, System.currentTimeMillis() + 1000);
|
||||
|
||||
float limit = (LAUNCH_RINGS * RING_SPACING) + RING_SPACING;
|
||||
|
||||
for (float r = RING_SPACING; r < limit; r++)
|
||||
{
|
||||
double[][] points = UtilMath.normalCircle(player.getLocation(), player.getVelocity(), r, Math.round(RING_DENSITY * r));
|
||||
|
||||
for (int i = 0; i < points.length; i++)
|
||||
{
|
||||
UtilParticle.PlayParticleToAll(UtilParticle.ParticleType.EXPLODE, new Location(player.getWorld(), points[i][0], points[i][1], points[i][2]),
|
||||
null, 0, 1, UtilParticle.ViewDist.NORMAL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onUpdate(UpdateEvent event)
|
||||
{
|
||||
if(event.getType() != UpdateType.FASTEST)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for(Iterator<Map.Entry<Player, Long>> it = _playerMap.entrySet().iterator(); it.hasNext();)
|
||||
{
|
||||
Map.Entry<Player, Long> e = it.next();
|
||||
|
||||
if(e.getValue() <= System.currentTimeMillis())
|
||||
{
|
||||
it.remove();
|
||||
continue;
|
||||
}
|
||||
|
||||
Location loc = e.getKey().getLocation().add(0, Y_OFFSET, 0);
|
||||
|
||||
for (int i = 0; i < PARTICLES; ++i)
|
||||
{
|
||||
UtilParticle.playColoredParticleToAll(java.awt.Color.RED, UtilParticle.ParticleType.RED_DUST,
|
||||
UtilMath.gauss(loc, DISTRIBUTION, DISTRIBUTION, DISTRIBUTION), 0, UtilParticle.ViewDist.NORMAL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,176 @@
|
||||
package mineplex.core.gadget.gadgets.particle;
|
||||
|
||||
import mineplex.core.arcadeevents.CoreGameStartEvent;
|
||||
import mineplex.core.arcadeevents.CoreGameStopEvent;
|
||||
import mineplex.core.blockrestore.BlockRestore;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.LineFormat;
|
||||
import mineplex.core.common.util.UtilBlock;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilParticle;
|
||||
import mineplex.core.common.util.UtilShapes;
|
||||
import mineplex.core.common.util.UtilSound;
|
||||
import mineplex.core.common.util.UtilText;
|
||||
import mineplex.core.common.util.banner.CountryFlag;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
import mineplex.core.gadget.types.ParticleGadget;
|
||||
import mineplex.core.treasure.event.TreasureFinishEvent;
|
||||
import mineplex.core.treasure.event.TreasureStartEvent;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.block.BlockFadeEvent;
|
||||
import org.bukkit.event.block.BlockPhysicsEvent;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author J Teissler
|
||||
* @date 6/26/17
|
||||
*/
|
||||
public class ParticleAuraNiceness extends ParticleGadget
|
||||
{
|
||||
/** Radius within which flowers not allowed near treasure chests */
|
||||
private static final int TREASURE_RADIUS = 4;
|
||||
|
||||
private static final double H_FIELD = 0.5;
|
||||
private static final double V_FIELD = 0.35;
|
||||
private static final int ROSE_PROBABILITY = 30;
|
||||
private static final double ROSE_RADIUS = 2.5;
|
||||
|
||||
private final Set<Block> _blocks = new HashSet<>();
|
||||
|
||||
/** Locations at which treasure is currently being opened */
|
||||
private final Map<UUID, Location> _openingTreasure = new HashMap<>();
|
||||
|
||||
private boolean _enabled = true;
|
||||
|
||||
public ParticleAuraNiceness(GadgetManager manager)
|
||||
{
|
||||
super(manager, "Aura of Niceness",
|
||||
UtilText.splitLineToArray(C.cGray + "Canadians are always nice online.", LineFormat.LORE), -8, Material.WOOL,
|
||||
(byte) 0);
|
||||
|
||||
setDisplayItem(CountryFlag.CANADA.getBanner());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void playParticle(Player player, UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.FASTER)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (Location location : _openingTreasure.values())
|
||||
{
|
||||
if (location.toVector().isInSphere(player.getLocation().toVector(), TREASURE_RADIUS))
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
UtilShapes.getCircle(player.getLocation().subtract(0, 0.5, 0), false, ROSE_RADIUS).stream().map(Location::getBlock)
|
||||
.collect(Collectors.toSet()).forEach(block ->
|
||||
{
|
||||
if (ThreadLocalRandom.current().nextInt(ROSE_PROBABILITY) == 0)
|
||||
{
|
||||
Block b = block.getRelative(BlockFace.UP);
|
||||
|
||||
if (b.isEmpty() && UtilBlock.fullSolid(block) && !UtilBlock.bottomSlab(block))
|
||||
{
|
||||
Location loc = b.getLocation().add(H_FIELD, V_FIELD, H_FIELD);
|
||||
|
||||
if (_enabled)
|
||||
{
|
||||
_blocks.add(b);
|
||||
Manager.getBlockRestore().add(b, Material.RED_ROSE.getId(), (byte) 3, 5000);
|
||||
}
|
||||
|
||||
for (int i = 0; i < 20; ++i)
|
||||
{
|
||||
UtilParticle.playColoredParticleToAll(Color.RED, UtilParticle.ParticleType.RED_DUST, UtilMath.gauss(loc, 4, 4, 4), 0, UtilParticle.ViewDist.NORMAL);
|
||||
UtilParticle.playColoredParticleToAll(Color.WHITE, UtilParticle.ParticleType.RED_DUST, UtilMath.gauss(loc, 4, 4, 4), 0, UtilParticle.ViewDist.NORMAL);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
for(Iterator<Block> it = _blocks.iterator(); it.hasNext();)
|
||||
{
|
||||
Block b = it.next();
|
||||
|
||||
if (b.getType() != Material.RED_ROSE)
|
||||
{
|
||||
it.remove();
|
||||
Location loc = b.getLocation().add(H_FIELD, V_FIELD, H_FIELD);
|
||||
for (int i = 0; i < 10; ++i)
|
||||
{
|
||||
UtilParticle.playColoredParticleToAll(Color.RED, UtilParticle.ParticleType.RED_DUST, UtilMath.gauss(loc, 6, 6, 6), 0, UtilParticle.ViewDist.NORMAL);
|
||||
UtilParticle.playColoredParticleToAll(Color.WHITE, UtilParticle.ParticleType.RED_DUST, UtilMath.gauss(loc, 6, 6, 6), 0, UtilParticle.ViewDist.NORMAL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onBlockFade(BlockPhysicsEvent event)
|
||||
{
|
||||
if (_blocks.contains(event.getBlock()))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Disable flowers in the area around treasure being opened.
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
public void disableOnTreasureStart(TreasureStartEvent event)
|
||||
{
|
||||
_openingTreasure.put(event.getPlayer().getUniqueId(), event.getPlayer().getLocation());
|
||||
Manager.getBlockRestore().restoreBlockAround(Material.CARPET, event.getPlayer().getLocation(), TREASURE_RADIUS);
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable flowers in the area around treasure no longer being opened.
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void enableOnTreasureFinish(TreasureFinishEvent event)
|
||||
{
|
||||
if (_openingTreasure.containsKey(event.getPlayer().getUniqueId()))
|
||||
{
|
||||
_openingTreasure.remove(event.getPlayer().getUniqueId());
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onGameStart(CoreGameStartEvent event)
|
||||
{
|
||||
_enabled = false;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onGameEnd(CoreGameStopEvent event)
|
||||
{
|
||||
_enabled = true;
|
||||
}
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
package mineplex.core.gadget.gadgets.particle;
|
||||
|
||||
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.banner.CountryFlag;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
import mineplex.core.gadget.types.ParticleGadget;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.BannerMeta;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
/**
|
||||
* @author J Teissler
|
||||
* @date 6/26/17
|
||||
*/
|
||||
public class ParticleCanadian extends ParticleGadget
|
||||
{
|
||||
private static final int STRAND_COUNT = 9;
|
||||
private static final double STRAND_SPACING = 0.124;
|
||||
private static final double DISTANCE_FROM_FLOOR = 0.43;
|
||||
|
||||
public ParticleCanadian(GadgetManager manager)
|
||||
{
|
||||
super(manager, "Canadian Trail",
|
||||
UtilText.splitLineToArray(C.cGray + "Lead the way to freedom!", LineFormat.LORE),
|
||||
-8, Material.WOOL, (byte) 0);
|
||||
|
||||
ItemStack stack = CountryFlag.CANADA.getBanner();
|
||||
System.out.println(((BannerMeta)stack.getItemMeta()).getBaseColor().getColor().toString());
|
||||
setDisplayItem(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void playParticle(Player player, UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.TICK)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Location center = player.getLocation().add(0, DISTANCE_FROM_FLOOR, 0);
|
||||
|
||||
if (Manager.isMoving(player))
|
||||
{
|
||||
for (int i = 0; i < STRAND_COUNT; i++)
|
||||
{
|
||||
if (i < 3 || i > 5)
|
||||
{
|
||||
UtilParticle.playColoredParticleToAll(Color.RED, UtilParticle.ParticleType.RED_DUST,
|
||||
center.add(0, STRAND_SPACING, 0), 0, UtilParticle.ViewDist.NORMAL);
|
||||
}
|
||||
else
|
||||
{
|
||||
UtilParticle.playColoredParticleToAll(Color.WHITE, UtilParticle.ParticleType.RED_DUST,
|
||||
center.add(0, STRAND_SPACING, 0), 0, UtilParticle.ViewDist.NORMAL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
package mineplex.core.gadget.gadgets.particle;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.LineFormat;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilParticle;
|
||||
import mineplex.core.common.util.UtilText;
|
||||
import mineplex.core.common.util.banner.CountryFlag;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
import mineplex.core.gadget.types.ParticleGadget;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
/**
|
||||
* @author J Teissler
|
||||
* @date 6/26/17
|
||||
*/
|
||||
public class ParticleFreedomFireworks extends ParticleGadget
|
||||
{
|
||||
private static final Material[] BLOCKTYPES = {
|
||||
Material.REDSTONE_BLOCK,
|
||||
Material.LAPIS_BLOCK,
|
||||
Material.QUARTZ_BLOCK
|
||||
};
|
||||
|
||||
public ParticleFreedomFireworks(GadgetManager manager)
|
||||
{
|
||||
super(manager, "Freedom Fireworks",
|
||||
UtilText.splitLineToArray(C.cGray + "Keep your patriotism close.", LineFormat.LORE),
|
||||
-8, Material.WOOL, (byte) 0);
|
||||
|
||||
setDisplayItem(CountryFlag.USA.getBanner());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void playParticle(Player player, UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.FAST)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
String particle = UtilParticle.ParticleType.BLOCK_CRACK.getParticle(BLOCKTYPES[ThreadLocalRandom.current().nextInt(0, BLOCKTYPES.length)], 0);
|
||||
Location location = UtilMath.gauss(player.getEyeLocation(), 1, 1, 1);
|
||||
|
||||
for (int i = 0; i < 20; ++i)
|
||||
{
|
||||
UtilParticle.PlayParticleToAll(particle, location, null, 3.0f, 1, UtilParticle.ViewDist.NORMAL);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,80 @@
|
||||
package mineplex.core.gadget.gadgets.particle;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.LineFormat;
|
||||
import mineplex.core.common.util.UtilParticle;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilText;
|
||||
import mineplex.core.common.util.banner.CountryFlag;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
import mineplex.core.gadget.types.ParticleGadget;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import net.minecraft.server.v1_8_R3.MinecraftServer;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
|
||||
/**
|
||||
* @author J Teissler
|
||||
* @date 6/26/17
|
||||
*/
|
||||
public class ParticleStarSpangled extends ParticleGadget
|
||||
{
|
||||
private static final int STRAND_COUNT = 9;
|
||||
private static final double STRAND_SPACING = 0.124;
|
||||
private static final double DISTANCE_FROM_FLOOR = 0.43;
|
||||
|
||||
private static final Color BLUE = new Color(29, 26, 120);
|
||||
|
||||
public ParticleStarSpangled(GadgetManager manager)
|
||||
{
|
||||
super(manager, "Star Spangled Stripe",
|
||||
UtilText.splitLineToArray(C.cGray + "Blaze a trail of freedom!", LineFormat.LORE),
|
||||
-8, Material.WOOL, (byte) 0);
|
||||
setDisplayItem(CountryFlag.USA.getBanner());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void playParticle(Player player, UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.TICK)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Location center = player.getLocation().add(0, DISTANCE_FROM_FLOOR, 0);
|
||||
|
||||
if (Manager.isMoving(player))
|
||||
{
|
||||
for (int i = 0; i < STRAND_COUNT; i++)
|
||||
{
|
||||
if (i == 3 || i == 7)
|
||||
{
|
||||
if (player.getTicksLived() % 3 == 0)
|
||||
{
|
||||
UtilParticle.PlayParticleToAll(UtilParticle.ParticleType.FIREWORKS_SPARK,
|
||||
center.add(0, STRAND_SPACING, 0), 0f, 0f, 0f, 0f, 0, UtilParticle.ViewDist.NORMAL);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else if (i == 5)
|
||||
{
|
||||
if (player.getTicksLived() + 1 % 3 == 0)
|
||||
{
|
||||
UtilParticle.PlayParticleToAll(UtilParticle.ParticleType.FIREWORKS_SPARK,
|
||||
center.add(0, STRAND_SPACING, 0), 0f, 0f, 0f, 0f, 0, UtilParticle.ViewDist.NORMAL);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
UtilParticle.playColoredParticleToAll(BLUE, UtilParticle.ParticleType.RED_DUST,
|
||||
center.add(0, STRAND_SPACING, 0), 0, UtilParticle.ViewDist.NORMAL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package mineplex.core.gadget.set;
|
||||
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailFreedom;
|
||||
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailRedWhite;
|
||||
import mineplex.core.gadget.gadgets.death.DeathFreedom;
|
||||
import mineplex.core.gadget.gadgets.death.DeathMapleLeaf;
|
||||
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpFreedom;
|
||||
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpMaple;
|
||||
import mineplex.core.gadget.gadgets.particle.ParticleCanadian;
|
||||
import mineplex.core.gadget.gadgets.particle.freedom.ParticleFreedom;
|
||||
import mineplex.core.gadget.types.GadgetSet;
|
||||
|
||||
public class SetCanadian extends GadgetSet
|
||||
{
|
||||
|
||||
public SetCanadian(GadgetManager manager)
|
||||
{
|
||||
super(manager, "Canadian", "2x Holiday Points while active (Titles)",
|
||||
manager.getGadget(ArrowTrailRedWhite.class),
|
||||
manager.getGadget(DeathMapleLeaf.class),
|
||||
manager.getGadget(DoubleJumpMaple.class),
|
||||
manager.getGadget(ParticleCanadian.class));
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user