From 4085c998cd5e562792dc1738587c2237e30a4e36 Mon Sep 17 00:00:00 2001 From: Cheese Date: Fri, 27 Nov 2015 18:44:33 +1100 Subject: [PATCH] MUSIC 4 LIFE --- .../src/mineplex/game/clans/spawn/Spawn.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/spawn/Spawn.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/spawn/Spawn.java index 7e05a5fe9..aae254487 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/spawn/Spawn.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/spawn/Spawn.java @@ -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 _spawns; private WeightSet _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 + } + } }