MUSIC 4 LIFE

This commit is contained in:
Cheese 2015-11-27 18:44:33 +11:00
parent 408c2cf72a
commit 4085c998cd

View File

@ -4,6 +4,7 @@ import java.util.Set;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Effect;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.Material;
@ -61,6 +62,12 @@ public class Spawn extends MiniPlugin
private WeightSet<Location> _spawns;
private WeightSet<Location> _shops;
private ClansManager _clansManager;
private long _songEastLast = 0;
private long _songWestLast = 0;
private long _songEastLength = 345000; //Blocks
private long _songWestLength = 185000; //Chirp
public Spawn(JavaPlugin plugin, ClansManager clansManager)
{
@ -450,4 +457,21 @@ public class Spawn extends MiniPlugin
UtilPlayer.message(player, F.main("Clans", message));
}
}
@EventHandler
public void playDatMusicALLDAYLONG(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
if (UtilTime.elapsed(_songEastLast, _songEastLength))
{
getEastSpawn().getWorld().playEffect(getEastSpawn(), Effect.RECORD_PLAY, 2258); //Blocks
}
if (UtilTime.elapsed(_songWestLast, _songWestLength))
{
getEastSpawn().getWorld().playEffect(getEastSpawn(), Effect.RECORD_PLAY, 2259); //Chirp
}
}
}