From 2bb8023b47d0cf22681cf1e73ddd9f473c886bff Mon Sep 17 00:00:00 2001 From: LCastr0 Date: Thu, 12 Jan 2017 22:18:34 -0200 Subject: [PATCH] Changed chest spawn animation --- .../commands/UnlockCosmeticsCommand.java | 4 +-- .../mineplex/core/treasure/TreasureStyle.java | 2 +- .../animation/ChestSpawnAnimation.java | 27 ++++++++++++++----- 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/commands/UnlockCosmeticsCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/commands/UnlockCosmeticsCommand.java index 0da39bfe2..1381fe628 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/commands/UnlockCosmeticsCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/commands/UnlockCosmeticsCommand.java @@ -22,7 +22,7 @@ public class UnlockCosmeticsCommand extends CommandBase public UnlockCosmeticsCommand(GadgetManager plugin) { - super(plugin, Rank.SNR_MODERATOR, "unlockCosmetics"); + super(plugin, Rank.JNR_DEV, "unlockCosmetics"); _plugin = plugin; } @@ -85,7 +85,7 @@ public class UnlockCosmeticsCommand extends CommandBase } } } - 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) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureStyle.java b/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureStyle.java index 3fd0114c9..b2b3a7de2 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureStyle.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureStyle.java @@ -80,7 +80,7 @@ public enum TreasureStyle MINESTRIKE( ParticleType.FIREWORKS_SPARK, ParticleType.FIREWORKS_SPARK, - ParticleType.FIREWORKS_SPARK, + ParticleType.INSTANT_SPELL, Sound.EXPLODE, Sound.EXPLODE ); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/treasure/animation/ChestSpawnAnimation.java b/Plugins/Mineplex.Core/src/mineplex/core/treasure/animation/ChestSpawnAnimation.java index af45690f4..3ba457213 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/treasure/animation/ChestSpawnAnimation.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/treasure/animation/ChestSpawnAnimation.java @@ -113,10 +113,10 @@ public class ChestSpawnAnimation extends Animation { float scale = (float)((double)(ANIMATION_DURATION - getTicks()) / (double)ANIMATION_DURATION); - //Move Paticle Forwards + //Move Particle Forwards _particleLocation.add(_particleDirection); - //Play Particels + //Play Particles if (getTreasure().getTreasureType() == TreasureType.OLD) { 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, ViewDist.NORMAL, UtilServer.getPlayers()); } - else if (getTreasure().getTreasureType() == TreasureType.MYTHICAL) + else if (getTreasure().getTreasureType() == TreasureType.MYTHICAL || getTreasure().getTreasureType() == TreasureType.MINESTRIKE) { float y = 5 * scale; double width = 0.7 * ((double) getTicks() / (double) ANIMATION_DURATION); @@ -145,9 +145,17 @@ public class ChestSpawnAnimation extends Animation float x = (float) (Math.sin(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, - ViewDist.NORMAL, UtilServer.getPlayers()); + + if (getTreasure().getTreasureType() == TreasureType.MYTHICAL) + { + 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) @@ -268,7 +276,12 @@ public class ChestSpawnAnimation extends Animation 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) { UtilParticle.PlayParticle(particleType, _centerLocation, 0.2f, 0.2f, 0.2f, 0, 50,