2018-07-22 00:45:56 +00:00
|
|
|
package me.totalfreedom.totalfreedommod.command;
|
|
|
|
|
|
|
|
import me.totalfreedom.totalfreedommod.rank.Rank;
|
|
|
|
import org.bukkit.ChatColor;
|
|
|
|
import org.bukkit.command.Command;
|
|
|
|
import org.bukkit.command.CommandSender;
|
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
|
|
|
|
@CommandPermissions(level = Rank.OP, source = SourceType.ONLY_IN_GAME)
|
2020-03-30 23:43:57 +00:00
|
|
|
@CommandParameters(description = "Toggles player gravity on/off.", usage = "/<command>")
|
2018-07-22 00:45:56 +00:00
|
|
|
public class Command_gravity extends FreedomCommand
|
|
|
|
{
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
|
|
|
{
|
2018-08-12 04:21:57 +00:00
|
|
|
boolean enabled = !playerSender.hasGravity();
|
|
|
|
playerSender.setGravity(enabled);
|
|
|
|
msg((enabled ? "En" : "Dis") + "abled gravity.", (enabled ? ChatColor.GREEN : ChatColor.RED));
|
2018-07-22 00:45:56 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|