diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/kitselector/WaterWingsKitSelector.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/kitselector/WaterWingsKitSelector.java index a7a68a856..b3753844f 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/kitselector/WaterWingsKitSelector.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/kitselector/WaterWingsKitSelector.java @@ -5,6 +5,7 @@ import org.bukkit.Material; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; import org.bukkit.util.Vector; import mineplex.core.common.shape.ShapeWings; @@ -14,6 +15,8 @@ import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilText; import mineplex.core.gadget.GadgetManager; import mineplex.core.gadget.types.KitSelectorGadget; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; public class WaterWingsKitSelector extends KitSelectorGadget { @@ -21,6 +24,9 @@ public class WaterWingsKitSelector extends KitSelectorGadget private ShapeWings _wings = new ShapeWings(UtilParticle.ParticleType.DRIP_WATER.particleName, new Vector(0.2,0.2,0.2), 1, 0, false, ShapeWings.DEFAULT_ROTATION, ShapeWings.ANGEL_WING_PATTERN); private ShapeWings _wingsEdge = new ShapeWings(UtilParticle.ParticleType.DRIP_WATER.particleName, new Vector(0.1,0.1,0.1), 1, 0, true, ShapeWings.DEFAULT_ROTATION, ShapeWings.ANGEL_WING_PATTERN); + private int _tick = 0; + private int _lastTick = 0; + public WaterWingsKitSelector(GadgetManager manager) { super(manager, "Water Wings", UtilText.splitLinesToArray(new String[]{C.cGray + "Placeholder"}, LineFormat.LORE), @@ -30,10 +36,21 @@ public class WaterWingsKitSelector extends KitSelectorGadget @Override public void playParticle(Entity entity, Player playTo) { - double offsetY = getEntityYOffset(entity); - Location loc = entity.getLocation().add(0, offsetY, 0).add(entity.getLocation().getDirection().multiply(-0.2)); - _wings.display(loc, playTo); - _wingsEdge.display(loc, playTo); + if (_tick != _lastTick) + { + double offsetY = getEntityYOffset(entity); + Location loc = entity.getLocation().add(0, offsetY, 0).add(entity.getLocation().getDirection().multiply(-0.2)); + _wings.display(loc, playTo); + _wingsEdge.display(loc, playTo); + _lastTick = _tick; + } + } + + @EventHandler + public void onUpdate(UpdateEvent event) + { + if (event.getType() == UpdateType.FASTEST) + _tick++; } /** diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/KitSelectorGadget.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/KitSelectorGadget.java index 999958b5b..b8dff0bd6 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/KitSelectorGadget.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/KitSelectorGadget.java @@ -20,7 +20,8 @@ public abstract class KitSelectorGadget extends Gadget /** * Plays the next particle for the selected entity - * @param entity + * @param entity The entity of the selected kit + * @param playTo The player that will receive the particles */ public abstract void playParticle(Entity entity, Player playTo);