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.Bukkit;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Effect;
import org.bukkit.GameMode; import org.bukkit.GameMode;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
@ -62,6 +63,12 @@ public class Spawn extends MiniPlugin
private WeightSet<Location> _shops; private WeightSet<Location> _shops;
private ClansManager _clansManager; 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) public Spawn(JavaPlugin plugin, ClansManager clansManager)
{ {
super("Clan Spawn Zones", plugin); super("Clan Spawn Zones", plugin);
@ -450,4 +457,21 @@ public class Spawn extends MiniPlugin
UtilPlayer.message(player, F.main("Clans", message)); 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
}
}
} }