Changed chest spawn animation

This commit is contained in:
LCastr0 2017-01-12 22:18:34 -02:00 committed by cnr
parent 4a803c1482
commit 2bb8023b47
3 changed files with 23 additions and 10 deletions

View File

@ -22,7 +22,7 @@ public class UnlockCosmeticsCommand extends CommandBase<GadgetManager>
public UnlockCosmeticsCommand(GadgetManager plugin) public UnlockCosmeticsCommand(GadgetManager plugin)
{ {
super(plugin, Rank.SNR_MODERATOR, "unlockCosmetics"); super(plugin, Rank.JNR_DEV, "unlockCosmetics");
_plugin = plugin; _plugin = plugin;
} }
@ -85,7 +85,7 @@ public class UnlockCosmeticsCommand extends CommandBase<GadgetManager>
} }
} }
} }
UtilPlayer.message(caller, F.main("Unlock Cosmetics", "Added" + added + F.elem(" " + gadgetType.getCategoryType()) + UtilText.plural(" item", added) + "!")); UtilPlayer.message(caller, F.main("Unlock Cosmetics", "Added " + added + F.elem(" " + gadgetType.getCategoryType()) + UtilText.plural(" item", added) + "!"));
} }
private void addMounts(Player caller) private void addMounts(Player caller)

View File

@ -80,7 +80,7 @@ public enum TreasureStyle
MINESTRIKE( MINESTRIKE(
ParticleType.FIREWORKS_SPARK, ParticleType.FIREWORKS_SPARK,
ParticleType.FIREWORKS_SPARK, ParticleType.FIREWORKS_SPARK,
ParticleType.FIREWORKS_SPARK, ParticleType.INSTANT_SPELL,
Sound.EXPLODE, Sound.EXPLODE,
Sound.EXPLODE Sound.EXPLODE
); );

View File

@ -113,10 +113,10 @@ public class ChestSpawnAnimation extends Animation
{ {
float scale = (float)((double)(ANIMATION_DURATION - getTicks()) / (double)ANIMATION_DURATION); float scale = (float)((double)(ANIMATION_DURATION - getTicks()) / (double)ANIMATION_DURATION);
//Move Paticle Forwards //Move Particle Forwards
_particleLocation.add(_particleDirection); _particleLocation.add(_particleDirection);
//Play Particels //Play Particles
if (getTreasure().getTreasureType() == TreasureType.OLD) if (getTreasure().getTreasureType() == TreasureType.OLD)
{ {
UtilParticle.PlayParticle(getTreasure().getTreasureType().getStyle().getSecondaryParticle(), _centerLocation, 0.1f, 0.1f, 0.1f, 0, 1, UtilParticle.PlayParticle(getTreasure().getTreasureType().getStyle().getSecondaryParticle(), _centerLocation, 0.1f, 0.1f, 0.1f, 0, 1,
@ -134,7 +134,7 @@ public class ChestSpawnAnimation extends Animation
UtilParticle.PlayParticle(getTreasure().getTreasureType().getStyle().getSecondaryParticle(), newLoc, 0f, 0f, 0f, 0, 1, UtilParticle.PlayParticle(getTreasure().getTreasureType().getStyle().getSecondaryParticle(), newLoc, 0f, 0f, 0f, 0, 1,
ViewDist.NORMAL, UtilServer.getPlayers()); ViewDist.NORMAL, UtilServer.getPlayers());
} }
else if (getTreasure().getTreasureType() == TreasureType.MYTHICAL) else if (getTreasure().getTreasureType() == TreasureType.MYTHICAL || getTreasure().getTreasureType() == TreasureType.MINESTRIKE)
{ {
float y = 5 * scale; float y = 5 * scale;
double width = 0.7 * ((double) getTicks() / (double) ANIMATION_DURATION); double width = 0.7 * ((double) getTicks() / (double) ANIMATION_DURATION);
@ -146,8 +146,16 @@ public class ChestSpawnAnimation extends Animation
float x = (float) (Math.sin(getTicks()/4D + lead)); float x = (float) (Math.sin(getTicks()/4D + lead));
float z = (float) (Math.cos(getTicks()/4D + lead)); float z = (float) (Math.cos(getTicks()/4D + lead));
UtilParticle.PlayParticle(getTreasure().getTreasureType().getStyle().getSecondaryParticle(), _centerLocation.clone().add(x * width, y, z * width), 0f, 0f, 0f, 0, 1, if (getTreasure().getTreasureType() == TreasureType.MYTHICAL)
ViewDist.NORMAL, UtilServer.getPlayers()); {
UtilParticle.PlayParticle(getTreasure().getTreasureType().getStyle().getSecondaryParticle(), _centerLocation.clone().add(x * width, y, z * width), 0f, 0f, 0f, 0, 1,
ViewDist.NORMAL, UtilServer.getPlayers());
}
else
{
ColoredParticle coloredParticle = new ColoredParticle(ParticleType.RED_DUST, new DustSpellColor(Color.YELLOW), _centerLocation.clone().add(x * width, y, z * width));
coloredParticle.display();
}
} }
} }
else if (getTreasure().getTreasureType() == TreasureType.CHRISTMAS) else if (getTreasure().getTreasureType() == TreasureType.CHRISTMAS)
@ -268,7 +276,12 @@ public class ChestSpawnAnimation extends Animation
if (particleType != null) if (particleType != null)
{ {
if (getTreasure().getTreasureType() != TreasureType.FREEDOM && getTreasure().getTreasureType() != TreasureType.HAUNTED if (getTreasure().getTreasureType() == TreasureType.MINESTRIKE)
{
ColoredParticle coloredParticle = new ColoredParticle(ParticleType.RED_DUST, new DustSpellColor(Color.YELLOW), _centerLocation.clone().add(0, 1, 0));
coloredParticle.display(50);
}
else if (getTreasure().getTreasureType() != TreasureType.FREEDOM && getTreasure().getTreasureType() != TreasureType.HAUNTED
|| getTreasure().getTreasureType() != TreasureType.GINGERBREAD) || getTreasure().getTreasureType() != TreasureType.GINGERBREAD)
{ {
UtilParticle.PlayParticle(particleType, _centerLocation, 0.2f, 0.2f, 0.2f, 0, 50, UtilParticle.PlayParticle(particleType, _centerLocation, 0.2f, 0.2f, 0.2f, 0, 50,