Changed so it music will never be 'active'.

This commit is contained in:
Chiss 2014-08-23 05:36:57 +10:00
parent 2e031f1e4a
commit 11597285b8

View File

@ -3,12 +3,16 @@ package mineplex.core.gadget.types;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.gadget.GadgetManager; import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.event.GadgetActivateEvent;
import mineplex.core.gadget.gadgets.SongData; import mineplex.core.gadget.gadgets.SongData;
import mineplex.core.recharge.Recharge; import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
import org.bukkit.Bukkit;
import org.bukkit.Effect; import org.bukkit.Effect;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -31,8 +35,17 @@ public class MusicGadget extends Gadget
} }
@Override @Override
public void EnableCustom(Player player) public void Enable(Player player)
{ {
GadgetActivateEvent gadgetEvent = new GadgetActivateEvent(player, this);
Bukkit.getServer().getPluginManager().callEvent(gadgetEvent);
if (gadgetEvent.isCancelled())
{
UtilPlayer.message(player, F.main("Inventory", "You cannot use Inventory Items."));
return;
}
if (!Recharge.Instance.use(player, "Play Disc", _duration, true, false)) if (!Recharge.Instance.use(player, "Play Disc", _duration, true, false))
return; return;
@ -40,6 +53,12 @@ public class MusicGadget extends Gadget
_songs.add(new SongData(player.getLocation().getBlock(), _duration)); _songs.add(new SongData(player.getLocation().getBlock(), _duration));
} }
@Override
public void EnableCustom(Player player)
{
}
@Override @Override
public void DisableCustom(Player player) public void DisableCustom(Player player)