Mineplex/GOD DAMN COSMETICS/gadget/gadgets/SongData.java
Daniel Waggner 38a20f98c2 Removed Files
These two directories contain code that was removed from the src and dependencies of the compiled files. They were removed due to being either a. unnecessary or b. a royal pain in my booty.
2021-05-23 18:13:37 -07:00

47 lines
1015 B
Java

package mineplex.core.gadget.gadgets;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import org.bukkit.Material;
import org.bukkit.block.Block;
public class SongData
{
public Block Block;
public long EndTime;
public SongData(Block block, long duration)
{
Block = block;
EndTime = System.currentTimeMillis() + duration;
Block.setType(Material.JUKEBOX);
}
public boolean update()
{
if (System.currentTimeMillis() > EndTime)
{
if (Block.getType() == Material.JUKEBOX)
Block.setType(Material.AIR);
return true;
}
UtilParticle.PlayParticle(ParticleType.NOTE, Block.getLocation().add(0.5, 1, 0.5), 0.5f, 0.5f, 0.5f, 0f, 2,
ViewDist.NORMAL, UtilServer.getPlayers());
return false;
}
/**
* Forces this song's jukebox to revert to air
*/
public void disable()
{
Block.setType(Material.AIR);
}
}