Small edits

This commit is contained in:
William Burns 2015-12-31 01:24:58 +00:00
parent 874695cdf6
commit 637baed830

View File

@ -6,7 +6,6 @@ import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.util.*;
import java.util.List;
import java.util.concurrent.TimeUnit;
import org.bukkit.Color;
import org.bukkit.FireworkEffect;
@ -24,9 +23,11 @@ import org.bukkit.util.Vector;
import mineplex.core.MiniPlugin;
import mineplex.core.command.CommandCenter;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilFirework;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilShapes;
import mineplex.core.common.util.UtilTextBottom;
import mineplex.core.common.util.UtilTextMiddle;
import mineplex.core.common.util.UtilWorld;
import mineplex.core.updater.UpdateType;
@ -44,6 +45,7 @@ public class NewYearCountdown extends MiniPlugin
{
private boolean _inProgress;
private Location _center;
private Location _spawn;
private int _stage;
private BufferedImage _currentFrame;
@ -55,6 +57,7 @@ public class NewYearCountdown extends MiniPlugin
NewYearMessage.class, new NewYearHandler(this));
_center = new Location(UtilWorld.getWorld("world"), 0.5, 85, 37.5);
_spawn = new Location(UtilWorld.getWorld("world"), 0.5, 74, 0.5);
_inProgress = false;
}
@ -108,6 +111,8 @@ public class NewYearCountdown extends MiniPlugin
if (_stage <= 0)
return;
UtilTextBottom.display(C.cWhiteB + "New Year's Countdown - " + C.cGoldB + formatTimer(_stage), UtilServer.getPlayers());
_currentFrame = stringToBufferedImage(new Font("Tahoma", Font.PLAIN, 36), formatTimer(_stage));
}
@ -124,6 +129,7 @@ public class NewYearCountdown extends MiniPlugin
{
_currentFrame = stringToBufferedImage(new Font("Tahoma", Font.PLAIN, 20), "Happy New Year");
UtilTextMiddle.display(C.cGoldB + "2016", C.cYellowB + "Happy New Year!", UtilServer.getPlayers());
//fireworkCircle();
}
if (_stage <= -120)
@ -265,9 +271,17 @@ public class NewYearCountdown extends MiniPlugin
f.setFireworkMeta(fm);
}
private void fireworkCircle()
{
for (Location cur : UtilShapes.getPointsInCircle(_spawn, 35, 30))
{
UtilFirework.launchFirework(cur, FireworkEffect.Type.BALL, Color.FUCHSIA, false, true, cur.toVector().setY(3).multiply(1), 2);
}
}
public UtilParticle.ParticleType getRandomParticle()
{
List<UtilParticle.ParticleType> types = Arrays.asList(UtilParticle.ParticleType.FLAME, UtilParticle.ParticleType.HAPPY_VILLAGER, UtilParticle.ParticleType.RED_DUST);
List<UtilParticle.ParticleType> types = Arrays.asList(UtilParticle.ParticleType.FLAME, UtilParticle.ParticleType.HAPPY_VILLAGER, UtilParticle.ParticleType.RED_DUST, UtilParticle.ParticleType.FIREWORKS_SPARK);
return types.get(new Random().nextInt(types.size()));
}