mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-07-01 20:46:41 +00:00
Added Paper Check (#163)
This commit is contained in:
@ -4,21 +4,25 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.SENIOR_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Surprise someone.", usage = "/<command> <player>")
|
||||
public class Command_scare extends FreedomCommand
|
||||
public class Command_scare extends FreedomCommand
|
||||
{
|
||||
/* This command will not work on Paper because there was a patch to remove it. This will work on Spigot and Bukkit. */
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
if (!FUtil.isPaper())
|
||||
{
|
||||
msg("This command won't work on Paper!", ChatColor.RED);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (args.length == 0)
|
||||
{
|
||||
@ -36,7 +40,8 @@ public class Command_scare extends FreedomCommand
|
||||
msg("Scared " + player.getName());
|
||||
|
||||
player.spawnParticle(Particle.MOB_APPEARANCE, player.getLocation(), 4);
|
||||
for (int i = 0; i < 10; ++i) {
|
||||
for (int i = 0; i < 10; ++i)
|
||||
{
|
||||
player.playSound(player.getLocation(), Sound.ENTITY_ENDERMAN_SCREAM, 1, 0);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user