why dont i ever commit

This commit is contained in:
Super_
2020-01-11 17:44:13 -05:00
parent 98ed23969a
commit 89b91598fb
9 changed files with 74 additions and 4 deletions

View File

@ -9,7 +9,7 @@ import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
import org.bukkit.scheduler.BukkitTask;
@CommandPermissions(level = Rank.SENIOR_ADMIN, source = SourceType.ONLY_CONSOLE, blockHostConsole = true)
@CommandPermissions(level = Rank.SENIOR_ADMIN, source = SourceType.BOTH, blockHostConsole = true)
@CommandParameters(description = "Block a player's Minecraft input. This is evil, and I never should have wrote it.", usage = "/<command> <all | purge | <<partialname> on | off>>")
public class Command_lockup extends FreedomCommand
{

View File

@ -21,7 +21,7 @@ import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
@CommandPermissions(level = Rank.OP, source = SourceType.ONLY_IN_GAME)
@CommandParameters(description = "Access the shop", usage = "/<command> <buy> <item>")
@CommandParameters(description = "Access the shop", usage = "/<command> <buy <item> | action | list>")
public class Command_shop extends FreedomCommand
{
private final List<String> locations = Arrays.asList("Sofa", "Car", "Bed", "Kitchen", "Garage", "Basement", "Home Study");
@ -70,6 +70,16 @@ public class Command_shop extends FreedomCommand
cooldown(30, args[0]);
return true;
}
case "list":
case "items":
{
msg(prefix + ChatColor.GREEN + "Available items:");
for (ShopItem item : ShopItem.values())
{
msg(prefix + ChatColor.AQUA + item.getName() + ChatColor.GREEN + " - " + ChatColor.RED + item.getCost());
}
return true;
}
default:
{
return false;

View File

@ -18,7 +18,7 @@ import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
@CommandParameters(description = "Mutes a player with brute force.", usage = "/<command> [[-s] <player> [reason] | list | purge | all]", aliases = "mute")
@CommandParameters(description = "Mutes a player with brute force.", usage = "/<command> [[-s | -q] <player> [reason] | list | purge | all]", aliases = "mute")
public class Command_stfu extends FreedomCommand
{
@ -95,7 +95,9 @@ public class Command_stfu extends FreedomCommand
// -s option (smite)
boolean smite = args[0].equals("-s");
if (smite)
// -q option (shadowmute)
boolean quiet = args[0].equals("-q");
if (smite || quiet)
{
args = ArrayUtils.subarray(args, 1, args.length);
@ -121,6 +123,14 @@ public class Command_stfu extends FreedomCommand
FPlayer playerdata = plugin.pl.getPlayer(player);
if (playerdata.isMuted())
{
if (quiet || playerdata.isQuietMuted())
{
playerdata.setMuted(false);
playerdata.setQuietMuted(false);
msg("Unmuted " + player.getName() + " quietly");
return true;
}
FUtil.adminAction(sender.getName(), "Unmuting " + player.getName(), true);
playerdata.setMuted(false);
msg("Unmuted " + player.getName());
@ -136,6 +146,14 @@ public class Command_stfu extends FreedomCommand
return true;
}
if (quiet)
{
playerdata.setMuted(true);
playerdata.setQuietMuted(true);
msg("Muted " + player.getName() + " quietly");
return true;
}
FUtil.adminAction(sender.getName(), "Muting " + player.getName(), true);
playerdata.setMuted(true);

View File

@ -0,0 +1,21 @@
package me.totalfreedom.totalfreedommod.command;
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
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;
@CommandPermissions(level = Rank.TELNET_ADMIN, source = SourceType.BOTH)
@CommandParameters(description = "Toggle the server chat.", usage = "/<command>", aliases = "tc")
public class Command_togglechat extends FreedomCommand
{
@Override
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
{
ConfigEntry.TOGGLE_CHAT.setBoolean(!ConfigEntry.TOGGLE_CHAT.getBoolean());
FUtil.adminAction(sender.getName(), "Chat " + (ConfigEntry.TOGGLE_CHAT.getBoolean() ? "enabled" : "disabled") + ".", true);
return true;
}
}