PC-42 - Fireworks and Effects at end of tutorial

This commit is contained in:
William Burns 2016-03-29 23:41:31 +01:00
parent 1d4472255f
commit ed65f19417

View File

@ -6,6 +6,8 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import org.bukkit.Color;
import org.bukkit.FireworkEffect;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
@ -18,6 +20,8 @@ import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.plugin.java.JavaPlugin;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilFirework;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilTextBottom;
import mineplex.core.hologram.Hologram;
import mineplex.core.hologram.HologramManager;
@ -163,6 +167,7 @@ public abstract class Tutorial implements Listener, ObjectiveListener
System.out.println(String.format("Tutorial> [%s] finished tutorial [%s]", player.getName(), getName()));
playFinishEffects(player.getLocation());
onFinish(player);
}
@ -295,4 +300,28 @@ public abstract class Tutorial implements Listener, ObjectiveListener
{
return _playerSessionMap.get(player);
}
private void playFinishEffects(Location location)
{
// Firework
UtilFirework.launchFirework(
location,
FireworkEffect.Type.STAR,
Color.GREEN,
true,
true,
null,
1
);
// Particles
UtilParticle.PlayParticle(UtilParticle.ParticleType.HAPPY_VILLAGER,
location, 0.5F, 0.5F, 0.5F, 1, 3, UtilParticle.ViewDist.LONG);
UtilParticle.PlayParticle(UtilParticle.ParticleType.ENCHANTMENT_TABLE,
location, 0.5F, 0.5F, 0.5F, 1, 3, UtilParticle.ViewDist.LONG);
UtilParticle.PlayParticle(UtilParticle.ParticleType.HEART,
location, 0.5F, 0.5F, 0.5F, 1, 3, UtilParticle.ViewDist.LONG);
UtilParticle.PlayParticle(UtilParticle.ParticleType.NOTE,
location, 0.5F, 0.5F, 0.5F, 1, 3, UtilParticle.ViewDist.LONG);
}
}