mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-01 05:57:09 +00:00
LuckPerms Integration (1/2)
This is part 1 of 2 of the luckperms integration for our switch to permissions.
This commit is contained in:
parent
f91c21cc81
commit
65540b7f3a
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>me.totalfreedom</groupId>
|
||||
<artifactId>TotalFreedomMod</artifactId>
|
||||
<version>2023.02</version>
|
||||
<version>2023.03</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>commons</artifactId>
|
||||
@ -39,10 +39,17 @@
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>net.luckperms</groupId>
|
||||
<artifactId>api</artifactId>
|
||||
<version>5.4</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.bstats</groupId>
|
||||
<artifactId>bstats-bukkit</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<version>3.0.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
|
@ -87,10 +87,8 @@ public class AntiSpam extends FreedomService
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event)
|
||||
{
|
||||
String command = event.getMessage();
|
||||
final Player player = event.getPlayer();
|
||||
final FPlayer fPlayer = plugin.pl.getPlayer(player);
|
||||
fPlayer.setLastCommand(command);
|
||||
|
||||
if (fPlayer.allCommandsBlocked())
|
||||
{
|
||||
|
@ -110,6 +110,7 @@ public class TotalFreedomMod extends JavaPlugin
|
||||
public CoreProtectBridge cpb;
|
||||
public WorldEditBridge web;
|
||||
public WorldGuardBridge wgb;
|
||||
public LuckPermsBridge lpb;
|
||||
|
||||
public static TotalFreedomMod getPlugin()
|
||||
{
|
||||
@ -335,6 +336,7 @@ public class TotalFreedomMod extends JavaPlugin
|
||||
ldb = new LibsDisguisesBridge();
|
||||
web = new WorldEditBridge();
|
||||
wgb = new WorldGuardBridge();
|
||||
lpb = new LuckPermsBridge();
|
||||
}
|
||||
|
||||
private void initFun()
|
||||
|
@ -1,14 +1,9 @@
|
||||
package me.totalfreedom.totalfreedommod.admin;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.*;
|
||||
|
||||
import com.google.common.base.Strings;
|
||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FConverter;
|
||||
import me.totalfreedom.totalfreedommod.rank.DisplayableGroup;
|
||||
import me.totalfreedom.totalfreedommod.rank.GroupProvider;
|
||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
@ -16,12 +11,16 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.*;
|
||||
|
||||
public class Admin
|
||||
{
|
||||
private final List<String> ips = new ArrayList<>();
|
||||
private UUID uuid;
|
||||
private boolean active = true;
|
||||
private Rank rank = Rank.ADMIN;
|
||||
private DisplayableGroup rank = GroupProvider.ADMIN.getGroup();
|
||||
private Date lastLogin = new Date();
|
||||
private Boolean commandSpy = false;
|
||||
private Boolean potionSpy = false;
|
||||
@ -39,15 +38,14 @@ public class Admin
|
||||
{
|
||||
this.uuid = UUID.fromString(resultSet.getString("uuid"));
|
||||
this.active = resultSet.getBoolean("active");
|
||||
this.rank = Rank.findRank(resultSet.getString("rank"));
|
||||
this.rank = GroupProvider.fromArgument(resultSet.getString("rank")).getGroup();
|
||||
this.ips.clear();
|
||||
this.ips.addAll(FUtil.stringToList(resultSet.getString("ips")));
|
||||
this.lastLogin = new Date(resultSet.getLong("last_login"));
|
||||
this.commandSpy = resultSet.getBoolean("command_spy");
|
||||
this.potionSpy = resultSet.getBoolean("potion_spy");
|
||||
this.acFormat = resultSet.getString("ac_format");
|
||||
}
|
||||
catch (SQLException e)
|
||||
} catch (SQLException e)
|
||||
{
|
||||
FLog.severe("Failed to load admin: " + e.getMessage());
|
||||
}
|
||||
@ -71,18 +69,17 @@ public class Admin
|
||||
|
||||
public Map<String, Object> toSQLStorable()
|
||||
{
|
||||
Map<String, Object> map = new HashMap<String, Object>()
|
||||
{{
|
||||
put("uuid", uuid.toString());
|
||||
put("active", active);
|
||||
put("rank", rank.toString());
|
||||
put("ips", FUtil.listToString(ips));
|
||||
put("last_login", lastLogin.getTime());
|
||||
put("command_spy", commandSpy);
|
||||
put("potion_spy", potionSpy);
|
||||
put("ac_format", acFormat);
|
||||
}};
|
||||
return map;
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("uuid", uuid.toString());
|
||||
map.put("active", active);
|
||||
map.put("rank", rank.toString());
|
||||
map.put("ips", FUtil.listToString(ips));
|
||||
map.put("last_login", lastLogin.getTime());
|
||||
map.put("command_spy", commandSpy);
|
||||
map.put("potion_spy", potionSpy);
|
||||
map.put("ac_format", acFormat);
|
||||
return map;
|
||||
|
||||
}
|
||||
|
||||
// Util IP methods
|
||||
@ -154,50 +151,51 @@ public class Admin
|
||||
}
|
||||
}
|
||||
|
||||
private void setActiveSplitWorkToReduceComplexity(TotalFreedomMod plugin) {
|
||||
if (getRank().isAtLeast(Rank.ADMIN))
|
||||
private void setActiveSplitWorkToReduceComplexity(TotalFreedomMod plugin)
|
||||
{
|
||||
if (plugin.btb != null)
|
||||
if (getRank().isAtLeast(GroupProvider.ADMIN.getGroup()))
|
||||
{
|
||||
plugin.btb.killTelnetSessions(getName());
|
||||
}
|
||||
|
||||
// Ensure admins don't have admin functionality when removed (FS-222)
|
||||
AdminList.vanished.remove(getName());
|
||||
|
||||
if (plugin.esb != null)
|
||||
{
|
||||
plugin.esb.setVanished(getName(), false);
|
||||
}
|
||||
|
||||
setCommandSpy(false);
|
||||
setPotionSpy(false);
|
||||
|
||||
Server server = Bukkit.getServer();
|
||||
Player player = server.getPlayer(getUuid());
|
||||
|
||||
if (player != null)
|
||||
{
|
||||
// Update chats
|
||||
FPlayer freedomPlayer = plugin.pl.getPlayer(player);
|
||||
freedomPlayer.removeAdminFunctionality();
|
||||
|
||||
// Disable vanish
|
||||
for (Player player1 : server.getOnlinePlayers())
|
||||
if (plugin.btb != null)
|
||||
{
|
||||
player1.showPlayer(plugin, player);
|
||||
plugin.btb.killTelnetSessions(getName());
|
||||
}
|
||||
|
||||
// Ensure admins don't have admin functionality when removed (FS-222)
|
||||
AdminList.vanished.remove(getUuid());
|
||||
|
||||
if (plugin.esb != null)
|
||||
{
|
||||
plugin.esb.setVanished(getName(), false);
|
||||
}
|
||||
|
||||
setCommandSpy(false);
|
||||
setPotionSpy(false);
|
||||
|
||||
Server server = Bukkit.getServer();
|
||||
Player player = server.getPlayer(getUuid());
|
||||
|
||||
if (player != null)
|
||||
{
|
||||
// Update chats
|
||||
FPlayer freedomPlayer = plugin.pl.getPlayer(player);
|
||||
freedomPlayer.removeAdminFunctionality();
|
||||
|
||||
// Disable vanish
|
||||
for (Player player1 : server.getOnlinePlayers())
|
||||
{
|
||||
player1.showPlayer(plugin, player);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public Rank getRank()
|
||||
public DisplayableGroup getRank()
|
||||
{
|
||||
return rank;
|
||||
}
|
||||
|
||||
public void setRank(Rank rank)
|
||||
public void setRank(DisplayableGroup rank)
|
||||
{
|
||||
this.rank = rank;
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import me.totalfreedom.totalfreedommod.FreedomService;
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
import me.totalfreedom.totalfreedommod.rank.GroupProvider;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
@ -133,7 +134,9 @@ public class AdminList extends FreedomService
|
||||
return false;
|
||||
}
|
||||
|
||||
return admin.getRank().ordinal() >= Rank.SENIOR_ADMIN.ordinal();
|
||||
return admin.getRank().getLuckPermsGroup().getWeight().orElse(0)
|
||||
>= GroupProvider.SENIOR_ADMIN.getGroup().getLuckPermsGroup().getWeight().orElse(1);
|
||||
// We don't want this to return true if there's no group weight available.
|
||||
}
|
||||
|
||||
public Admin getAdmin(CommandSender sender)
|
||||
@ -286,29 +289,23 @@ public class AdminList extends FreedomService
|
||||
|
||||
public void deactivateOldEntries(boolean verbose)
|
||||
{
|
||||
for (Admin admin : allAdmins)
|
||||
allAdmins.stream()
|
||||
.filter(admin -> admin.isActive() && !admin.getRank().isAtLeast(GroupProvider.SENIOR_ADMIN.getGroup()))
|
||||
.forEach(admin ->
|
||||
{
|
||||
if (!admin.isActive() || admin.getRank().isAtLeast(Rank.SENIOR_ADMIN))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
final Date lastLogin = admin.getLastLogin();
|
||||
final long lastLoginHours = TimeUnit.HOURS.convert(new Date().getTime() - lastLogin.getTime(), TimeUnit.MILLISECONDS);
|
||||
|
||||
if (lastLoginHours < ConfigEntry.ADMINLIST_CLEAN_THESHOLD_HOURS.getInteger())
|
||||
{
|
||||
continue;
|
||||
return;
|
||||
}
|
||||
|
||||
if (verbose)
|
||||
{
|
||||
FUtil.adminAction("TotalFreedomMod", "Deactivating admin " + admin.getName() + ", inactive for " + lastLoginHours + " hours", true);
|
||||
}
|
||||
|
||||
admin.setActive(false);
|
||||
save(admin);
|
||||
}
|
||||
});
|
||||
|
||||
updateTables();
|
||||
}
|
||||
|
@ -0,0 +1,29 @@
|
||||
package me.totalfreedom.totalfreedommod.bridge;
|
||||
|
||||
import net.luckperms.api.LuckPerms;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.RegisteredServiceProvider;
|
||||
import org.bukkit.plugin.UnknownDependencyException;
|
||||
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
public class LuckPermsBridge
|
||||
{
|
||||
private final LuckPerms luckPerms;
|
||||
|
||||
public LuckPermsBridge()
|
||||
{
|
||||
RegisteredServiceProvider<LuckPerms> provider = Bukkit.getServicesManager()
|
||||
.getRegistration(LuckPerms.class);
|
||||
|
||||
if (provider == null) throw new UnknownDependencyException("LuckPerms must be present!");
|
||||
|
||||
this.luckPerms = provider.getProvider();
|
||||
}
|
||||
|
||||
public LuckPerms getAPI()
|
||||
{
|
||||
return luckPerms;
|
||||
}
|
||||
}
|
@ -2,13 +2,15 @@ package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.rank.GroupProvider;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface CommandPermissions
|
||||
{
|
||||
|
||||
Rank rank() default Rank.NON_OP;
|
||||
String permission() default "default";
|
||||
|
||||
SourceType source() default SourceType.BOTH;
|
||||
|
||||
|
@ -1,14 +1,13 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(rank = Rank.ADMIN, source = SourceType.BOTH)
|
||||
@CommandPermissions(permission = "adminchat", source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Talk privately with other admins on the server.", usage = "/<command> [message]", aliases = "o,sc,ac,staffchat")
|
||||
public class Command_adminchat extends FreedomCommand
|
||||
{
|
||||
@ -27,8 +26,7 @@ public class Command_adminchat extends FreedomCommand
|
||||
FPlayer userinfo = plugin.pl.getPlayer(playerSender);
|
||||
userinfo.setAdminChat(!userinfo.inAdminChat());
|
||||
msgNew("Admin chat turned <status>.", Placeholder.unparsed("status", userinfo.inAdminChat() ? "on" : "off"));
|
||||
}
|
||||
else
|
||||
} else
|
||||
{
|
||||
plugin.cm.adminChat(sender, StringUtils.join(args, " "));
|
||||
}
|
||||
|
@ -2,12 +2,11 @@ package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import java.util.List;
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(rank = Rank.OP, source = SourceType.BOTH)
|
||||
@CommandPermissions(permission = "admininfo", source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Information on how to apply for admin.", usage = "/<command>", aliases = "si,ai,staffinfo")
|
||||
public class Command_admininfo extends FreedomCommand
|
||||
{
|
||||
|
@ -4,14 +4,13 @@ import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(rank = Rank.ADMIN, source = SourceType.BOTH)
|
||||
@CommandPermissions(permission = "adminmode", source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Denies joining of operators and only allows admins to join.", usage = "/<command> [on | off]", aliases = "staffmode")
|
||||
public class Command_adminmode extends FreedomCommand
|
||||
{
|
||||
|
@ -4,7 +4,6 @@ import io.papermc.lib.PaperLib;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.world.WorldTime;
|
||||
import me.totalfreedom.totalfreedommod.world.WorldWeather;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
@ -13,7 +12,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(rank = Rank.OP, source = SourceType.BOTH)
|
||||
@CommandPermissions(permission = "adminworld", source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Allows for admins to configure time, and weather of the AdminWorld, and allows for admins and ops to go to the AdminWorld.",
|
||||
usage = "/<command> [time <morning | noon | evening | night> | weather <off | rain | storm>]",
|
||||
aliases = "sw,aw,staffworld")
|
||||
@ -50,7 +49,7 @@ public class Command_adminworld extends FreedomCommand
|
||||
{
|
||||
switch (commandMode)
|
||||
{
|
||||
case TELEPORT:
|
||||
case TELEPORT ->
|
||||
{
|
||||
if (!(sender instanceof Player) || playerSender == null)
|
||||
{
|
||||
@ -61,8 +60,7 @@ public class Command_adminworld extends FreedomCommand
|
||||
try
|
||||
{
|
||||
adminWorld = plugin.wm.adminworld.getWorld();
|
||||
}
|
||||
catch (Exception ignored)
|
||||
} catch (Exception ignored)
|
||||
{
|
||||
}
|
||||
|
||||
@ -70,15 +68,13 @@ public class Command_adminworld extends FreedomCommand
|
||||
{
|
||||
msgNew("Going to the main world.");
|
||||
PaperLib.teleportAsync(playerSender, server.getWorlds().get(0).getSpawnLocation());
|
||||
}
|
||||
else
|
||||
} else
|
||||
{
|
||||
msgNew("Going to the AdminWorld.");
|
||||
plugin.wm.adminworld.sendToWorld(playerSender);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TIME:
|
||||
case TIME ->
|
||||
{
|
||||
assertCommandPerms(sender, playerSender);
|
||||
|
||||
@ -89,20 +85,17 @@ public class Command_adminworld extends FreedomCommand
|
||||
{
|
||||
plugin.wm.adminworld.setTimeOfDay(timeOfDay);
|
||||
msgNew("AdminWorld time set to: <time>", Placeholder.unparsed("time", timeOfDay.name()));
|
||||
}
|
||||
else
|
||||
} else
|
||||
{
|
||||
msgNew("<red>Invalid time of day. Can be: sunrise, noon, sunset, midnight");
|
||||
}
|
||||
}
|
||||
else
|
||||
} else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case WEATHER:
|
||||
case WEATHER ->
|
||||
{
|
||||
assertCommandPerms(sender, playerSender);
|
||||
|
||||
@ -113,20 +106,17 @@ public class Command_adminworld extends FreedomCommand
|
||||
{
|
||||
plugin.wm.adminworld.setWeatherMode(weatherMode);
|
||||
msgNew("AdminWorld weather set to <mode>.", Placeholder.unparsed("mode", weatherMode.name()));
|
||||
}
|
||||
else
|
||||
} else
|
||||
{
|
||||
msgNew("<red>Invalid weather mode. Can be: off, rain, storm");
|
||||
}
|
||||
}
|
||||
else
|
||||
} else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
default ->
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -148,7 +138,7 @@ public class Command_adminworld extends FreedomCommand
|
||||
// TODO: Redo this properly
|
||||
private void assertCommandPerms(CommandSender sender, Player playerSender) throws PermissionDeniedException
|
||||
{
|
||||
if (!(sender instanceof Player) || playerSender == null || !isAdmin(sender))
|
||||
if (!(sender instanceof Player) || playerSender == null || !sender.hasPermission("tfm.adminworld.manage"))
|
||||
{
|
||||
throw new PermissionDeniedException();
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import org.bukkit.GameMode;
|
||||
@ -8,7 +7,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(rank = Rank.OP, source = SourceType.BOTH)
|
||||
@CommandPermissions(permission = "adventure", source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Quickly change your own gamemode to adventure, define someone's username to change theirs, or change everyone's gamemode on the server.", usage = "/<command> <[partialname] | -a>", aliases = "gma")
|
||||
public class Command_adventure extends FreedomCommand
|
||||
{
|
||||
@ -29,7 +28,7 @@ public class Command_adventure extends FreedomCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
checkRank(Rank.ADMIN);
|
||||
checkPermission("tfm.adventure.other");
|
||||
|
||||
if (args[0].equals("-a"))
|
||||
{
|
||||
|
@ -1,12 +1,11 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(rank = Rank.ADMIN, source = SourceType.BOTH)
|
||||
@CommandPermissions(permission = "announce", source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Make an announcement anonymously to operators.", usage = "/<command> <message>")
|
||||
public class Command_announce extends FreedomCommand
|
||||
{
|
||||
|
@ -1,12 +1,11 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(rank = Rank.ADMIN, source = SourceType.BOTH)
|
||||
@CommandPermissions(permission = "autoclear", source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Toggle whether or not a player has their inventory automatically cleared when they join", usage = "/<command> <player>")
|
||||
public class Command_autoclear extends FreedomCommand
|
||||
{
|
||||
|
@ -1,12 +1,11 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(rank = Rank.ADMIN, source = SourceType.BOTH)
|
||||
@CommandPermissions(permission = "autotp", source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Toggle whether or not a player is automatically teleported when they join", usage = "/<command> <player>")
|
||||
public class Command_autotp extends FreedomCommand
|
||||
{
|
||||
|
@ -7,12 +7,10 @@ import me.totalfreedom.totalfreedommod.banning.Ban;
|
||||
import me.totalfreedom.totalfreedommod.player.PlayerData;
|
||||
import me.totalfreedom.totalfreedommod.punishments.Punishment;
|
||||
import me.totalfreedom.totalfreedommod.punishments.PunishmentType;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
@ -20,7 +18,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(rank = Rank.ADMIN, source = SourceType.BOTH, blockHostConsole = true)
|
||||
@CommandPermissions(permission = "ban", source = SourceType.BOTH, blockHostConsole = true)
|
||||
@CommandParameters(description = "Bans the specified player.", usage = "/<command> <username> [reason] [-nrb | -q]", aliases = "gtfo")
|
||||
public class Command_ban extends FreedomCommand
|
||||
{
|
||||
|
@ -1,18 +1,15 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.banning.Ban;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(rank = Rank.ADMIN, source = SourceType.BOTH, blockHostConsole = true)
|
||||
@CommandPermissions(permission = "banip", source = SourceType.BOTH, blockHostConsole = true)
|
||||
@CommandParameters(description = "Bans the specified ip.", usage = "/<command> <ip> [reason] [-q]")
|
||||
public class Command_banip extends FreedomCommand
|
||||
{
|
||||
|
@ -1,6 +1,5 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import org.bukkit.command.Command;
|
||||
@ -10,7 +9,7 @@ import org.bukkit.entity.Player;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@CommandPermissions(rank = Rank.OP, source = SourceType.BOTH)
|
||||
@CommandPermissions(permission = "banlist", source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Shows all banned player names. Admins may optionally use 'purge' to clear the list.", usage = "/<command> [purge]")
|
||||
public class Command_banlist extends FreedomCommand
|
||||
{
|
||||
@ -21,7 +20,7 @@ public class Command_banlist extends FreedomCommand
|
||||
{
|
||||
if (args[0].equalsIgnoreCase("purge"))
|
||||
{
|
||||
checkRank(Rank.SENIOR_ADMIN);
|
||||
checkPermission("tfm.banlist.purge");
|
||||
FUtil.adminAction(sender.getName(), "Purging the ban list", true);
|
||||
msgNew("<green>Purged <amount> player bans.", Placeholder.unparsed("amount", String.valueOf(plugin.bm.purge())));
|
||||
return true;
|
||||
@ -39,6 +38,6 @@ public class Command_banlist extends FreedomCommand
|
||||
@Override
|
||||
protected List<String> getTabCompleteOptions(CommandSender sender, Command command, String alias, String[] args)
|
||||
{
|
||||
return args.length == 1 && plugin.al.isSeniorAdmin(sender) ? Collections.singletonList("purge") : Collections.emptyList();
|
||||
return args.length == 1 && sender.hasPermission("tfm.banlist.purge") ? Collections.singletonList("purge") : Collections.emptyList();
|
||||
}
|
||||
}
|
@ -1,17 +1,15 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.banning.Ban;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(rank = Rank.ADMIN, source = SourceType.BOTH, blockHostConsole = true)
|
||||
@CommandPermissions(permission = "banname", source = SourceType.BOTH, blockHostConsole = true)
|
||||
@CommandParameters(description = "Bans the specified name.", usage = "/<command> <name> [reason] [-q]")
|
||||
public class Command_banname extends FreedomCommand
|
||||
{
|
||||
|
@ -3,14 +3,13 @@ package me.totalfreedom.totalfreedommod.command;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.SplittableRandom;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(rank = Rank.OP, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandPermissions(permission = "bird", source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "Spawns a random type of fish at your location.", usage = "/<command>")
|
||||
public class Command_bird extends FreedomCommand
|
||||
{
|
||||
|
@ -3,14 +3,13 @@ package me.totalfreedom.totalfreedommod.command;
|
||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||
import me.totalfreedom.totalfreedommod.punishments.Punishment;
|
||||
import me.totalfreedom.totalfreedommod.punishments.PunishmentType;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(rank = Rank.ADMIN, source = SourceType.BOTH)
|
||||
@CommandPermissions(permission = "blockcmd", source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Block all commands for everyone on the server, or a specific player.", usage = "/<command> <-a | purge | <player>>", aliases = "blockcommands,blockcommand,bc,bcmd")
|
||||
public class Command_blockcmd extends FreedomCommand
|
||||
{
|
||||
|
@ -3,10 +3,8 @@ package me.totalfreedom.totalfreedommod.command;
|
||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||
import me.totalfreedom.totalfreedommod.punishments.Punishment;
|
||||
import me.totalfreedom.totalfreedommod.punishments.PunishmentType;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.HumanEntity;
|
||||
@ -15,7 +13,7 @@ import org.bukkit.entity.Player;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@CommandPermissions(rank = Rank.ADMIN, source = SourceType.BOTH)
|
||||
@CommandPermissions(permission = "blockedit", source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Restricts/restores block modification abilities for everyone on the server or a certain player.", usage = "/<command> [<player> [reason] | list | purge | all]")
|
||||
public class Command_blockedit extends FreedomCommand
|
||||
{
|
||||
|
@ -3,7 +3,6 @@ package me.totalfreedom.totalfreedommod.command;
|
||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||
import me.totalfreedom.totalfreedommod.punishments.Punishment;
|
||||
import me.totalfreedom.totalfreedommod.punishments.PunishmentType;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import org.bukkit.command.Command;
|
||||
@ -12,7 +11,7 @@ import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@CommandPermissions(rank = Rank.ADMIN, source = SourceType.BOTH)
|
||||
@CommandPermissions(permission = "blockpvp", source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Toggle PVP mode for everyone or a certain player.", usage = "/<command> [<player> | list | purge | all]", aliases = "pvpblock,pvpmode")
|
||||
public class Command_blockpvp extends FreedomCommand
|
||||
{
|
||||
|
@ -1,14 +1,13 @@
|
||||
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;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
@CommandPermissions(rank = Rank.ADMIN, source = SourceType.BOTH)
|
||||
@CommandPermissions(permission = "blockredstone", source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Blocks redstone on the server.", usage = "/<command>", aliases = "bre")
|
||||
public class Command_blockredstone extends FreedomCommand
|
||||
{
|
||||
|
@ -7,9 +7,7 @@ import java.util.List;
|
||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||
import me.totalfreedom.totalfreedommod.punishments.Punishment;
|
||||
import me.totalfreedom.totalfreedommod.punishments.PunishmentType;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
@ -17,7 +15,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(rank = Rank.ADMIN, source = SourceType.BOTH)
|
||||
@CommandPermissions(permission = "cage", source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Place a cage around someone with certain blocks, or someone's player head.", usage = "/<command> <purge | <partialname> [head | block] [playername | blockname]")
|
||||
public class Command_cage extends FreedomCommand
|
||||
{
|
||||
|
@ -1,6 +1,5 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.command.Command;
|
||||
@ -9,7 +8,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
@CommandPermissions(rank = Rank.ADMIN, source = SourceType.BOTH)
|
||||
@CommandPermissions(permission = "cake", source = SourceType.BOTH)
|
||||
@CommandParameters(description = "For the people that are still alive - gives a cake to everyone on the server.", usage = "/<command>")
|
||||
public class Command_cake extends FreedomCommand
|
||||
{
|
||||
|
@ -1,13 +1,12 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(rank = Rank.ADMIN, source = SourceType.BOTH)
|
||||
@CommandPermissions(permission = "cleanchat", source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Clears the chat.", usage = "/<command>", aliases = "cc")
|
||||
public class Command_cleanchat extends FreedomCommand
|
||||
{
|
||||
|
@ -1,11 +1,10 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(rank = Rank.ADMIN, source = SourceType.ONLY_CONSOLE)
|
||||
@CommandPermissions(permission = "cleardiscordqueue", source = SourceType.ONLY_CONSOLE)
|
||||
@CommandParameters(description = "Clear the discord message queue.", usage = "/<command>")
|
||||
public class Command_cleardiscordqueue extends FreedomCommand
|
||||
{
|
||||
|
@ -1,15 +1,15 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(rank = Rank.OP, source = SourceType.BOTH)
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@CommandPermissions(permission = "clearinventory", source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Clear your inventory.", usage = "/<command> [player]", aliases = "ci,clear")
|
||||
public class Command_clearinventory extends FreedomCommand
|
||||
{
|
||||
@ -25,8 +25,7 @@ public class Command_clearinventory extends FreedomCommand
|
||||
|
||||
playerSender.getInventory().clear();
|
||||
msgNew("<green>Your inventory has been cleared.");
|
||||
}
|
||||
else
|
||||
} else
|
||||
{
|
||||
if (plugin.al.isAdmin(sender))
|
||||
{
|
||||
@ -35,8 +34,7 @@ public class Command_clearinventory extends FreedomCommand
|
||||
FUtil.adminAction(sender.getName(), "Clearing everyone's inventory", true);
|
||||
server.getOnlinePlayers().forEach(player -> player.getInventory().clear());
|
||||
msgNew("<green>Successfully cleared everyone's inventory.");
|
||||
}
|
||||
else
|
||||
} else
|
||||
{
|
||||
Player player = getPlayer(args[0]);
|
||||
|
||||
@ -50,8 +48,7 @@ public class Command_clearinventory extends FreedomCommand
|
||||
msgNew("<green>Successfully cleared <player>'s inventory.", Placeholder.unparsed("player", player.getName()));
|
||||
msgNew(player, "<sender> has cleared your inventory.", Placeholder.unparsed("sender", sender.getName()));
|
||||
}
|
||||
}
|
||||
else
|
||||
} else
|
||||
{
|
||||
return noPerms();
|
||||
}
|
||||
|
@ -1,15 +1,12 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.api.ShopItem;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(rank = Rank.OP, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandPermissions(permission = "clownfish", source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "Obtain a clown fish", usage = "/<command>")
|
||||
public class Command_clownfish extends FreedomCommand
|
||||
{
|
||||
|
@ -1,13 +1,12 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.admin.Admin;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(rank = Rank.ADMIN, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandPermissions(permission = "cmdspy", source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "Spy on commands", usage = "/<command>", aliases = "commandspy")
|
||||
public class Command_cmdspy extends FreedomCommand
|
||||
{
|
||||
|
@ -2,12 +2,8 @@ package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
import me.totalfreedom.totalfreedommod.player.PlayerData;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -15,7 +11,7 @@ import org.bukkit.entity.Player;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@CommandPermissions(rank = Rank.OP, source = SourceType.BOTH)
|
||||
@CommandPermissions(permission = "coins", source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Shows the amount of coins you or another player has. Also allows you to give coins to other players.", usage = "/<command> [player] | pay <player> <amount>")
|
||||
public class Command_coins extends FreedomCommand
|
||||
{
|
||||
|
@ -1,9 +1,6 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.ChatColor;
|
||||
@ -11,11 +8,10 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(rank = Rank.ADMIN, source = SourceType.ONLY_CONSOLE)
|
||||
@CommandPermissions(permission = "consolesay", source = SourceType.ONLY_CONSOLE)
|
||||
@CommandParameters(description = "Telnet/Console command - Send a chat message with chat formatting over telnet.", usage = "/<command> <message>", aliases = "csay")
|
||||
public class Command_consolesay extends FreedomCommand
|
||||
{
|
||||
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
|
@ -1,13 +1,9 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Random;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@ -15,7 +11,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
@CommandPermissions(rank = Rank.ADMIN, source = SourceType.BOTH)
|
||||
@CommandPermissions(permission = "cookie", source = SourceType.BOTH)
|
||||
@CommandParameters(description = "For those who have no friends - gives a cookie to everyone on the server.", usage = "/<command>")
|
||||
public class Command_cookie extends FreedomCommand
|
||||
{
|
||||
|
@ -28,7 +28,7 @@ public class Command_creative extends FreedomCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
checkRank(Rank.ADMIN);
|
||||
checkPermission(Rank.ADMIN);
|
||||
|
||||
if (args[0].equals("-a"))
|
||||
{
|
||||
|
@ -1,7 +1,6 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import java.util.SplittableRandom;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.command.Command;
|
||||
@ -9,7 +8,7 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
@CommandPermissions(rank = Rank.OP, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandPermissions(permission = "deafen", source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "Makes random sounds.", usage = "/<command>")
|
||||
public class Command_deafen extends FreedomCommand
|
||||
{
|
||||
|
@ -1,12 +1,9 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import net.kyori.adventure.text.format.TextDecoration;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@ -14,7 +11,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
@CommandPermissions(rank = Rank.OP, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandPermissions(permission = "debugstick", source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "Get a stick of happiness.", usage = "/<command>")
|
||||
public class Command_debugstick extends FreedomCommand
|
||||
{
|
||||
|
@ -1,12 +1,11 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
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(rank = Rank.ADMIN, source = SourceType.BOTH)
|
||||
@CommandPermissions(permission = "denick", source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Essentials Interface Command - Remove the nickname of all players on the server.", usage = "/<command>")
|
||||
public class Command_denick extends FreedomCommand
|
||||
{
|
||||
|
@ -1,15 +1,15 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.rank.GroupProvider;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import net.luckperms.api.model.user.User;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(rank = Rank.ADMIN, source = SourceType.BOTH)
|
||||
@CommandPermissions(permission = "deop", source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Deop a player", usage = "/<command> <partialname>")
|
||||
public class Command_deop extends FreedomCommand
|
||||
{
|
||||
@ -27,32 +27,29 @@ public class Command_deop extends FreedomCommand
|
||||
silent = args[1].equalsIgnoreCase("-s");
|
||||
}
|
||||
|
||||
final String targetName = args[0].toLowerCase();
|
||||
Player player = Bukkit.getServer().getPlayer(args[0]);
|
||||
|
||||
final List<String> matchedPlayerNames = new ArrayList<>();
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
if (player == null)
|
||||
{
|
||||
if ((player.getName().toLowerCase().contains(targetName) || player.getDisplayName().toLowerCase().contains(targetName)
|
||||
|| player.getName().contains(targetName) || player.getDisplayName().contains(targetName)) &&
|
||||
player.isOp() && !plugin.al.isVanished(player.getUniqueId()))
|
||||
{
|
||||
matchedPlayerNames.add(player.getName());
|
||||
player.setOp(false);
|
||||
msg(player, YOU_ARE_NOT_OP);
|
||||
plugin.rm.updateDisplay(player);
|
||||
}
|
||||
msg(sender, PLAYER_NOT_FOUND);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!matchedPlayerNames.isEmpty())
|
||||
if (plugin.al.isVanished(player.getUniqueId()))
|
||||
{
|
||||
if (!silent)
|
||||
{
|
||||
FUtil.adminAction(sender.getName(), "De-opping " + StringUtils.join(matchedPlayerNames, ", "), false);
|
||||
}
|
||||
msgNew("<red>You cannot de-op <player>, as they are vanished.", Placeholder.unparsed("player", player.getName()));
|
||||
return true;
|
||||
}
|
||||
else
|
||||
|
||||
User user = GroupProvider.getUser(player);
|
||||
user.setPrimaryGroup(GroupProvider.NON_OP.getGroup().getLuckPermsGroup().getName());
|
||||
msg(player, YOU_ARE_NOT_OP);
|
||||
plugin.rm.updateDisplay(player);
|
||||
|
||||
|
||||
if (!silent)
|
||||
{
|
||||
msgNew("Either the player is already deopped, or the player could not be found.");
|
||||
FUtil.adminAction(sender.getName(), "De-opping " + player.getName(), false);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -1,12 +1,13 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.rank.GroupProvider;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.luckperms.api.model.user.User;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(rank = Rank.ADMIN, source = SourceType.BOTH, blockHostConsole = true)
|
||||
@CommandPermissions(permission = "", source = SourceType.BOTH, blockHostConsole = true)
|
||||
@CommandParameters(description = "Deop everyone on the server.", usage = "/<command>")
|
||||
public class Command_deopall extends FreedomCommand
|
||||
{
|
||||
@ -16,12 +17,13 @@ public class Command_deopall extends FreedomCommand
|
||||
{
|
||||
FUtil.adminAction(sender.getName(), "De-opping all players on the server", true);
|
||||
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
server.getOnlinePlayers().forEach(player ->
|
||||
{
|
||||
player.setOp(false);
|
||||
User user = GroupProvider.getUser(player);
|
||||
user.setPrimaryGroup(GroupProvider.NON_OP.getGroup().getLuckPermsGroup().getName());
|
||||
msg(player, YOU_ARE_NOT_OP);
|
||||
plugin.rm.updateDisplay(player);
|
||||
}
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -2,7 +2,6 @@ package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
@ -16,7 +15,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
@CommandPermissions(rank = Rank.OP, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandPermissions(permission = "dispfill", source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "Fill nearby dispensers with a set of items of your choice.", usage = "/<command> <radius> <comma,separated,items>")
|
||||
public class Command_dispfill extends FreedomCommand
|
||||
{
|
||||
|
@ -5,7 +5,6 @@ import me.totalfreedom.totalfreedommod.banning.Ban;
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
import me.totalfreedom.totalfreedommod.punishments.Punishment;
|
||||
import me.totalfreedom.totalfreedommod.punishments.PunishmentType;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
@ -18,7 +17,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
@CommandPermissions(rank = Rank.SENIOR_ADMIN, source = SourceType.ONLY_CONSOLE, blockHostConsole = true)
|
||||
@CommandPermissions(permission = "doom", source = SourceType.ONLY_CONSOLE, blockHostConsole = true)
|
||||
@CommandParameters(description = "Sends the specified player to their doom.", usage = "/<command> <playername> [reason]")
|
||||
public class Command_doom extends FreedomCommand
|
||||
{
|
||||
|
@ -1,13 +1,11 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(rank = Rank.OP, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandPermissions(permission = "eject", source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "Eject any entities that are riding you.", usage = "/<command>")
|
||||
public class Command_eject extends FreedomCommand
|
||||
{
|
||||
|
@ -8,10 +8,8 @@ import java.util.Objects;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@ -19,7 +17,7 @@ import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
@CommandPermissions(rank = Rank.OP, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandPermissions(permission = "enchant", source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "Enchant items.", usage = "/<command> <list | addall | reset | add <name> [level] | remove <name>>")
|
||||
public class Command_enchant extends FreedomCommand
|
||||
{
|
||||
|
@ -1,11 +1,10 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(rank = Rank.NON_OP, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandPermissions(permission = "end", source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "Go to \"The End\".", usage = "/<command>")
|
||||
public class Command_end extends FreedomCommand
|
||||
{
|
||||
|
@ -3,7 +3,6 @@ package me.totalfreedom.totalfreedommod.command;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import me.totalfreedom.totalfreedommod.util.Groups;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
@ -13,7 +12,7 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(rank = Rank.ADMIN, source = SourceType.BOTH)
|
||||
@CommandPermissions(permission = "entitywipe", source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Remove various server entities that may cause lag, such as dropped items, minecarts, and boats.", usage = "/<command> [name | -a]", aliases = "ew,rd")
|
||||
public class Command_entitywipe extends FreedomCommand
|
||||
{
|
||||
|
@ -2,7 +2,6 @@ package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
@ -12,7 +11,7 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
@CommandPermissions(rank = Rank.ADMIN, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandPermissions(permission = "expel", source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "Push people away from you.", usage = "/<command> [radius] [strength]")
|
||||
public class Command_expel extends FreedomCommand
|
||||
{
|
||||
|
@ -2,7 +2,6 @@ package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.bukkit.command.Command;
|
||||
@ -11,7 +10,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
@CommandPermissions(rank = Rank.SENIOR_ADMIN, source = SourceType.BOTH)
|
||||
@CommandPermissions(permission = "explode", source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Surprise someone.", usage = "/<command> <player>")
|
||||
public class Command_explode extends FreedomCommand
|
||||
{
|
||||
|
@ -1,7 +1,6 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import net.kyori.adventure.text.minimessage.tag.Tag;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
@ -10,7 +9,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(rank = Rank.ADMIN, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandPermissions(permission = "explosivearrows", source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "Make arrows explode", usage = "/<command>", aliases = "ea")
|
||||
public class Command_explosivearrows extends FreedomCommand
|
||||
{
|
||||
|
@ -1,13 +1,12 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(rank = Rank.ADMIN, source = SourceType.BOTH)
|
||||
@CommandPermissions(permission = "findip", source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Shows all IPs registered to a player", usage = "/<command> <player>", aliases = "showip,listip")
|
||||
public class Command_findip extends FreedomCommand
|
||||
{
|
||||
|
@ -1,13 +1,12 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.api.ShopItem;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(rank = Rank.OP, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandPermissions(permission = "fireball", source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "Obtain a fire ball", usage = "/<command>")
|
||||
public class Command_fireball extends FreedomCommand
|
||||
{
|
||||
|
@ -1,12 +1,11 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(rank = Rank.NON_OP, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandPermissions(permission = "flatlands", source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "Go to the Flatlands.", usage = "/<command>")
|
||||
public class Command_flatlands extends FreedomCommand
|
||||
{
|
||||
@ -17,8 +16,7 @@ public class Command_flatlands extends FreedomCommand
|
||||
if (ConfigEntry.FLATLANDS_GENERATE.getBoolean())
|
||||
{
|
||||
plugin.wm.flatlands.sendToWorld(playerSender);
|
||||
}
|
||||
else
|
||||
} else
|
||||
{
|
||||
msgNew("<red>Flatlands is currently disabled in the TotalFreedomMod configuration.");
|
||||
}
|
||||
|
@ -1,11 +1,10 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(rank = Rank.OP, source = SourceType.BOTH)
|
||||
@CommandPermissions(permission = "forcekill", source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Forcefully kill someone - for those who REALLY need to die.", usage = "/<command> <playername>")
|
||||
public class Command_forcekill extends FreedomCommand
|
||||
{
|
||||
@ -13,7 +12,7 @@ public class Command_forcekill extends FreedomCommand
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
if (!plugin.al.isAdmin(sender) && !senderIsConsole)
|
||||
if (!sender.hasPermission("tfm.forcekill.other") && !senderIsConsole)
|
||||
{
|
||||
playerSender.setHealth(0);
|
||||
return true;
|
||||
|
@ -1,20 +1,13 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.freeze.FreezeData;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import net.kyori.adventure.title.Title;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.time.Duration;
|
||||
|
||||
@CommandPermissions(rank = Rank.ADMIN, source = SourceType.BOTH)
|
||||
@CommandPermissions(permission = "freeze", source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Freeze/Unfreeze a specified player, or all non-admins on the server.", usage = "/<command> [target | purge]", aliases = "fr")
|
||||
public class Command_freeze extends FreedomCommand
|
||||
{
|
||||
|
@ -1,13 +1,12 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(rank = Rank.SENIOR_ADMIN, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandPermissions(permission = "fuckoff", source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "You'll never even see it coming - repeatedly push players away from you until command is untoggled.", usage = "/<command> <on [radius (default=25)] | off>")
|
||||
public class Command_fuckoff extends FreedomCommand
|
||||
{
|
||||
|
@ -1,15 +1,13 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(rank = Rank.ADMIN, source = SourceType.BOTH, blockHostConsole = true)
|
||||
@CommandPermissions(permission = "gcmd", source = SourceType.BOTH, blockHostConsole = true)
|
||||
@CommandParameters(description = "Send a command as someone else.", usage = "/<command> <fromname> <outcommand>")
|
||||
public class Command_gcmd extends FreedomCommand
|
||||
{
|
||||
|
@ -1,6 +1,5 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@ -8,7 +7,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
|
||||
@CommandPermissions(rank = Rank.OP, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandPermissions(permission = "glow", source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "Toggles the glowing outline effect because y'all lazy as fuck", usage = "/<command>")
|
||||
public class Command_glow extends FreedomCommand
|
||||
{
|
||||
|
@ -1,13 +1,12 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.api.ShopItem;
|
||||
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(rank = Rank.OP, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandPermissions(permission = "grapplinghook", source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "Obtain a grappling hook", usage = "/<command>")
|
||||
public class Command_grapplinghook extends FreedomCommand
|
||||
{
|
||||
|
@ -1,12 +1,11 @@
|
||||
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(rank = Rank.OP, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandPermissions(permission = "gravity", source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "Toggles player gravity on/off.", usage = "/<command>")
|
||||
public class Command_gravity extends FreedomCommand
|
||||
{
|
||||
|
@ -3,7 +3,6 @@ package me.totalfreedom.totalfreedommod.command;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||
import org.apache.commons.lang.math.DoubleRange;
|
||||
import org.bukkit.ChatColor;
|
||||
@ -13,7 +12,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
import org.bukkit.scheduler.BukkitTask;
|
||||
|
||||
@CommandPermissions(rank = Rank.OP, source = SourceType.BOTH)
|
||||
@CommandPermissions(permission = "health", source = SourceType.BOTH)
|
||||
@CommandParameters(description = "View server health, such as ticks-per-second, memory, etc.", usage = "/<command>")
|
||||
public class Command_health extends FreedomCommand
|
||||
{
|
||||
|
@ -1,11 +1,10 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(rank = Rank.SENIOR_ADMIN, source = SourceType.ONLY_CONSOLE)
|
||||
@CommandPermissions(permission = "indefban", source = SourceType.ONLY_CONSOLE)
|
||||
@CommandParameters(description = "Reload the indefinite ban list.", usage = "/<command> <reload>", aliases = "ib")
|
||||
public class Command_indefban extends FreedomCommand
|
||||
{
|
||||
|
@ -6,14 +6,13 @@ import java.util.Optional;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.player.PlayerData;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(rank = Rank.OP, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandPermissions(permission = "inspect", source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "Block inspector tool for operators.", usage = "/<command> [history] [page]", aliases = "ins")
|
||||
public class Command_inspect extends FreedomCommand
|
||||
{
|
||||
|
@ -3,7 +3,6 @@ package me.totalfreedom.totalfreedommod.command;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.command.Command;
|
||||
@ -11,7 +10,7 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
|
||||
@CommandPermissions(rank = Rank.OP, source = SourceType.BOTH)
|
||||
@CommandPermissions(permission = "invis", source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Shows (optionally clears) invisible players", usage = "/<command> [clear]")
|
||||
public class Command_invis extends FreedomCommand
|
||||
{
|
||||
|
@ -1,7 +1,6 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@ -9,7 +8,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
@CommandPermissions(rank = Rank.OP, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandPermissions(permission = "invsee", source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "Look into another player's inventory, or optionally take items out.", usage = "/<command> <player> [offhand | armor]", aliases = "inv,insee")
|
||||
public class Command_invsee extends FreedomCommand
|
||||
{
|
||||
@ -51,8 +50,7 @@ public class Command_invsee extends FreedomCommand
|
||||
inventory.setItem(1, offhand);
|
||||
playerSender.openInventory(inventory);
|
||||
return true;
|
||||
}
|
||||
else if (args[1].equals("armor"))
|
||||
} else if (args[1].equals("armor"))
|
||||
{
|
||||
Inventory inventory = server.createInventory(null, 9, player.getName() + "'s armor");
|
||||
inventory.setContents(player.getInventory().getArmorContents());
|
||||
|
@ -1,16 +1,16 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import me.totalfreedom.totalfreedommod.fun.Jumppads;
|
||||
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(rank = Rank.OP, source = SourceType.ONLY_IN_GAME)
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@CommandPermissions(permission = "jumppads", source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "Toggles jumppads on/off, view the status of jumppads, or make them sideways.", usage = "/<command> <on | off | info | sideways <on | off>>", aliases = "launchpads,jp")
|
||||
public class Command_jumppads extends FreedomCommand
|
||||
{
|
||||
@ -41,8 +41,7 @@ public class Command_jumppads extends FreedomCommand
|
||||
}
|
||||
msg("Disabled your jumppads.", ChatColor.GRAY);
|
||||
plugin.jp.players.put(playerSender, Jumppads.JumpPadMode.OFF);
|
||||
}
|
||||
else
|
||||
} else
|
||||
{
|
||||
if (plugin.jp.players.get(playerSender) != Jumppads.JumpPadMode.OFF)
|
||||
{
|
||||
@ -52,8 +51,7 @@ public class Command_jumppads extends FreedomCommand
|
||||
msg("Enabled your jumpppads.", ChatColor.GRAY);
|
||||
plugin.jp.players.put(playerSender, Jumppads.JumpPadMode.MADGEEK);
|
||||
}
|
||||
}
|
||||
else
|
||||
} else
|
||||
{
|
||||
if (plugin.jp.players.get(playerSender) == Jumppads.JumpPadMode.OFF)
|
||||
{
|
||||
@ -72,8 +70,7 @@ public class Command_jumppads extends FreedomCommand
|
||||
}
|
||||
msg("Set Jumppads mode to: Normal", ChatColor.GRAY);
|
||||
plugin.jp.players.put(playerSender, Jumppads.JumpPadMode.MADGEEK);
|
||||
}
|
||||
else
|
||||
} else
|
||||
{
|
||||
if (plugin.jp.players.get(playerSender) == Jumppads.JumpPadMode.NORMAL_AND_SIDEWAYS)
|
||||
{
|
||||
@ -83,8 +80,7 @@ public class Command_jumppads extends FreedomCommand
|
||||
msg("Set Jumppads mode to: Normal and Sideways", ChatColor.GRAY);
|
||||
plugin.jp.players.put(playerSender, Jumppads.JumpPadMode.NORMAL_AND_SIDEWAYS);
|
||||
}
|
||||
}
|
||||
else
|
||||
} else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -95,15 +91,10 @@ public class Command_jumppads extends FreedomCommand
|
||||
@Override
|
||||
public List<String> getTabCompleteOptions(CommandSender sender, Command command, String alias, String[] args)
|
||||
{
|
||||
if (!plugin.al.isAdmin(sender))
|
||||
{
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if (args.length == 1)
|
||||
{
|
||||
return Arrays.asList("on", "off", "info", "sideways");
|
||||
}
|
||||
else if (args.length == 2)
|
||||
} else if (args.length == 2)
|
||||
{
|
||||
if (args[0].equals("sideways"))
|
||||
{
|
||||
|
@ -2,9 +2,9 @@ package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.punishments.Punishment;
|
||||
import me.totalfreedom.totalfreedommod.punishments.PunishmentType;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.ChatColor;
|
||||
@ -12,7 +12,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(rank = Rank.ADMIN, source = SourceType.BOTH)
|
||||
@CommandPermissions(permission = "kick", source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Kick the specified player.", usage = "/<command> <player> [reason] [-q]")
|
||||
public class Command_kick extends FreedomCommand
|
||||
{
|
||||
@ -38,17 +38,14 @@ public class Command_kick extends FreedomCommand
|
||||
if (args[args.length - 1].equalsIgnoreCase("-q"))
|
||||
{
|
||||
silent = true;
|
||||
FLog.debug("silent");
|
||||
|
||||
if (args.length >= 2)
|
||||
{
|
||||
FLog.debug("set reason (silent)");
|
||||
reason = StringUtils.join(ArrayUtils.subarray(args, 1, args.length - 1), " ");
|
||||
}
|
||||
}
|
||||
else if (args.length > 1)
|
||||
{
|
||||
FLog.debug("set reason");
|
||||
reason = StringUtils.join(ArrayUtils.subarray(args, 1, args.length), " ");
|
||||
}
|
||||
|
||||
@ -74,7 +71,7 @@ public class Command_kick extends FreedomCommand
|
||||
}
|
||||
else
|
||||
{
|
||||
msg("Kicked " + player.getName() + " quietly.");
|
||||
msgNew("Kicked <player> quietly.", Placeholder.unparsed("player", player.getName()));
|
||||
}
|
||||
|
||||
player.kickPlayer(builder.toString());
|
||||
|
@ -1,6 +1,5 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
@ -8,7 +7,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(rank = Rank.ADMIN, source = SourceType.BOTH)
|
||||
@CommandPermissions(permission = "kickall", source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Kick all non-admins on server.", usage = "/<command>", aliases = "kickall")
|
||||
public class Command_kicknoob extends FreedomCommand
|
||||
{
|
||||
|
@ -3,8 +3,7 @@ package me.totalfreedom.totalfreedommod.command;
|
||||
import java.util.Iterator;
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
import me.totalfreedom.totalfreedommod.fun.Landminer.Landmine;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import org.bukkit.ChatColor;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
@ -12,7 +11,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(rank = Rank.OP, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandPermissions(permission = "landmine", source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "Set a landmine trap.", usage = "/<command>")
|
||||
public class Command_landmine extends FreedomCommand
|
||||
{
|
||||
@ -22,13 +21,13 @@ public class Command_landmine extends FreedomCommand
|
||||
{
|
||||
if (!ConfigEntry.LANDMINES_ENABLED.getBoolean())
|
||||
{
|
||||
msg("The landmine is currently disabled.", ChatColor.GREEN);
|
||||
msgNew("<red>Landmines are currently disabled.");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!ConfigEntry.ALLOW_EXPLOSIONS.getBoolean())
|
||||
{
|
||||
msg("Explosions are currently disabled.", ChatColor.GREEN);
|
||||
msgNew("<red>Explosions are currently disabled.");
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -41,7 +40,7 @@ public class Command_landmine extends FreedomCommand
|
||||
final Iterator<Landmine> landmines = plugin.lm.getLandmines().iterator();
|
||||
while (landmines.hasNext())
|
||||
{
|
||||
msg(landmines.next().toString());
|
||||
msgNew(landmines.next().toString());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -59,7 +58,7 @@ public class Command_landmine extends FreedomCommand
|
||||
landmine.setType(Material.TNT);
|
||||
plugin.lm.add(new Landmine(landmine.getLocation(), playerSender, radius));
|
||||
|
||||
msg("Landmine planted - Radius = " + radius + " blocks.", ChatColor.GREEN);
|
||||
msgNew("<green>Landmine planted - Radius: <radius> blocks.", Placeholder.unparsed("radius", String.valueOf(radius)));
|
||||
return true;
|
||||
}
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||
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(rank = Rank.ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Show the last command the specified player used.", usage = "/<command> <player>")
|
||||
public class Command_lastcmd extends FreedomCommand
|
||||
{
|
||||
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
if (args.length == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
final Player player = getPlayer(args[0]);
|
||||
|
||||
if (player == null)
|
||||
{
|
||||
msg(FreedomCommand.PLAYER_NOT_FOUND);
|
||||
return true;
|
||||
}
|
||||
|
||||
final FPlayer playerdata = plugin.pl.getPlayer(player);
|
||||
|
||||
if (playerdata != null)
|
||||
{
|
||||
String lastCommand = playerdata.getLastCommand();
|
||||
if (lastCommand.isEmpty())
|
||||
{
|
||||
lastCommand = "(none)";
|
||||
}
|
||||
msg(player.getName() + " - Last Command: " + lastCommand, ChatColor.GRAY);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
@ -31,12 +31,12 @@ public class Command_list extends FreedomCommand
|
||||
case "-s", "-a" -> listFilter = ListFilter.ADMINS;
|
||||
case "-v" ->
|
||||
{
|
||||
checkRank(Rank.ADMIN);
|
||||
checkPermission(Rank.ADMIN);
|
||||
listFilter = ListFilter.VANISHED_ADMINS;
|
||||
}
|
||||
case "-t" ->
|
||||
{
|
||||
checkRank(Rank.ADMIN);
|
||||
checkPermission(Rank.ADMIN);
|
||||
listFilter = ListFilter.TELNET_SESSIONS;
|
||||
}
|
||||
default ->
|
||||
|
@ -28,7 +28,7 @@ public class Command_loginmessage extends FreedomCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
checkRank(Rank.ADMIN);
|
||||
checkPermission(Rank.ADMIN);
|
||||
|
||||
String message = StringUtils.join(args, " ");
|
||||
if (!message.contains("%rank%") && !message.contains("%coloredrank%"))
|
||||
|
@ -11,7 +11,6 @@ import net.kyori.adventure.text.minimessage.tag.Tag;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -40,7 +39,7 @@ public class Command_myadmin extends FreedomCommand
|
||||
// -o switch
|
||||
if (args[0].equals("-o"))
|
||||
{
|
||||
checkRank(Rank.SENIOR_ADMIN);
|
||||
checkPermission(Rank.SENIOR_ADMIN);
|
||||
init = playerSender;
|
||||
targetPlayer = getPlayer(args[1]);
|
||||
if (targetPlayer == null)
|
||||
|
@ -1,23 +1,24 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import me.totalfreedom.totalfreedommod.admin.Admin;
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.rank.DisplayableGroup;
|
||||
import me.totalfreedom.totalfreedommod.rank.GroupProvider;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import me.totalfreedom.totalfreedommod.util.PermissibleCompletion;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(rank = Rank.OP, source = SourceType.BOTH)
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@CommandPermissions(permission = "saconfig", source = SourceType.BOTH)
|
||||
@CommandParameters(description = "List, add, remove, or set the rank of admins, clean or reload the admin list, or view admin information.", usage = "/<command> <list | clean | reload | | setrank <username> <rank> | <add | remove | info> <username>>", aliases = "slconfig")
|
||||
public class Command_saconfig extends FreedomCommand
|
||||
{
|
||||
@ -41,7 +42,7 @@ public class Command_saconfig extends FreedomCommand
|
||||
case "clean":
|
||||
{
|
||||
checkConsole();
|
||||
checkRank(Rank.SENIOR_ADMIN);
|
||||
checkPermission("tfm.saconfig.clean");
|
||||
|
||||
FUtil.adminAction(sender.getName(), "Cleaning the admin list", true);
|
||||
plugin.al.deactivateOldEntries(true);
|
||||
@ -51,7 +52,7 @@ public class Command_saconfig extends FreedomCommand
|
||||
|
||||
case "reload":
|
||||
{
|
||||
checkRank(Rank.SENIOR_ADMIN);
|
||||
checkPermission("tfm.saconfig.reload");
|
||||
|
||||
FUtil.adminAction(sender.getName(), "Reloading the admin list", true);
|
||||
plugin.al.load();
|
||||
@ -62,27 +63,22 @@ public class Command_saconfig extends FreedomCommand
|
||||
case "setrank":
|
||||
{
|
||||
checkConsole();
|
||||
checkRank(Rank.SENIOR_ADMIN);
|
||||
checkPermission("tfm.saconfig.setrank");
|
||||
|
||||
if (args.length < 3)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Rank rank = Rank.findRank(args[2]);
|
||||
DisplayableGroup rank = GroupProvider.fromArgument(args[2]).getGroup();
|
||||
if (rank == null)
|
||||
{
|
||||
msgNew("<red>Unknown rank: <rank>", Placeholder.unparsed("rank", args[2]));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (rank.isConsole())
|
||||
{
|
||||
msgNew("<red>What, did you think it was going to be that easy?");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!rank.isAtLeast(Rank.ADMIN))
|
||||
if (!rank.isAtLeast(GroupProvider.ADMIN.getGroup()))
|
||||
{
|
||||
msgNew("<red>Rank must be Admin or higher.");
|
||||
return true;
|
||||
@ -111,8 +107,7 @@ public class Command_saconfig extends FreedomCommand
|
||||
plugin.dc.syncRoles(admin, plugin.pl.getData(admin.getName()).getDiscordID());
|
||||
}
|
||||
|
||||
msgNew("Set <admin>'s rank to <rank>.", Placeholder.unparsed("admin", admin.getName()),
|
||||
Placeholder.unparsed("rank", rank.getName()));
|
||||
msgNew("Set <admin>'s rank to <rank>.", Placeholder.unparsed("admin", admin.getName()), Placeholder.unparsed("rank", rank.getName()));
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -124,7 +119,7 @@ public class Command_saconfig extends FreedomCommand
|
||||
return false;
|
||||
}
|
||||
|
||||
checkRank(Rank.ADMIN);
|
||||
checkPermission("tfm.saconfig.info");
|
||||
|
||||
Admin admin = plugin.al.getEntryByName(args[1]);
|
||||
|
||||
@ -141,8 +136,7 @@ public class Command_saconfig extends FreedomCommand
|
||||
{
|
||||
msgNew("Unknown admin: <player>", Placeholder.unparsed("player", args[1]));
|
||||
return true;
|
||||
}
|
||||
else
|
||||
} else
|
||||
{
|
||||
msgNew(admin.toString());
|
||||
}
|
||||
@ -158,7 +152,7 @@ public class Command_saconfig extends FreedomCommand
|
||||
}
|
||||
|
||||
checkConsole();
|
||||
checkRank(Rank.ADMIN);
|
||||
checkPermission("tfm.saconfig.add");
|
||||
|
||||
// Player already admin?
|
||||
final Player player = getPlayer(args[1]);
|
||||
@ -193,8 +187,7 @@ public class Command_saconfig extends FreedomCommand
|
||||
|
||||
plugin.al.addAdmin(admin);
|
||||
plugin.rm.updateDisplay(player);
|
||||
}
|
||||
else // Existing admin
|
||||
} else // Existing admin
|
||||
{
|
||||
FUtil.adminAction(sender.getName(), "Re-adding " + player.getName() + " to the admin list", true);
|
||||
admin.addIp(FUtil.getIp(player));
|
||||
@ -217,7 +210,7 @@ public class Command_saconfig extends FreedomCommand
|
||||
fPlayer.getFreezeData().setFrozen(false);
|
||||
msgNew(player, "You have been unfrozen.");
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -229,7 +222,7 @@ public class Command_saconfig extends FreedomCommand
|
||||
}
|
||||
|
||||
checkConsole();
|
||||
checkRank(Rank.ADMIN);
|
||||
checkPermission("tfm.saconfig.remove");
|
||||
|
||||
Player player = getPlayer(args[1]);
|
||||
|
||||
@ -274,27 +267,19 @@ public class Command_saconfig extends FreedomCommand
|
||||
{
|
||||
if (args.length == 1)
|
||||
{
|
||||
List<String> arguments = new ArrayList<>();
|
||||
arguments.add("list");
|
||||
if (plugin.al.isAdmin(sender))
|
||||
{
|
||||
arguments.add("info");
|
||||
arguments.add("add");
|
||||
arguments.add("remove");
|
||||
}
|
||||
if (plugin.al.isSeniorAdmin(sender))
|
||||
{
|
||||
arguments.add("reload");
|
||||
arguments.add("clean");
|
||||
arguments.add("setrank");
|
||||
}
|
||||
return arguments;
|
||||
return argumentCompletions(args[0],
|
||||
PermissibleCompletion.of("tfm.saconfig.info", "info"),
|
||||
PermissibleCompletion.of("tfm.saconfig.add", "add"),
|
||||
PermissibleCompletion.of("tfm.saconfig.remove", "remove"),
|
||||
PermissibleCompletion.of("tfm.saconfig.reload", "reload"),
|
||||
PermissibleCompletion.of("tfm.saconfig.clean", "clean"),
|
||||
PermissibleCompletion.of("tfm.saconfig.setrank", "setrank"));
|
||||
}
|
||||
if (args.length == 2 && (args[0].equals("add") || args[0].equals("remove") || args[0].equals("setrank") || args[0].equals("info")))
|
||||
{
|
||||
return FUtil.getPlayerList();
|
||||
return playerCompletions(args[1]);
|
||||
}
|
||||
if (args.length == 3 && args[0].equals("setrank"))
|
||||
if (args.length == 3 && args[0].equals("setrank") && sender.hasPermission("tfm.saconfig.setrank"))
|
||||
{
|
||||
return Arrays.asList("ADMIN", "SENIOR_ADMIN");
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ public class Command_survival extends FreedomCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
checkRank(Rank.ADMIN);
|
||||
checkPermission(Rank.ADMIN);
|
||||
|
||||
if (args[0].equals("-a"))
|
||||
{
|
||||
|
@ -1,15 +1,13 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.banning.Ban;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(rank = Rank.ADMIN, source = SourceType.BOTH)
|
||||
@CommandPermissions(permission = "unbanip", source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Unbans the specified IP.", usage = "/<command> <ip> [-q]")
|
||||
public class Command_unbanip extends FreedomCommand
|
||||
{
|
||||
|
@ -1,14 +1,12 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(rank = Rank.ADMIN, source = SourceType.BOTH)
|
||||
@CommandPermissions(permission = "unblockcmd", source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Unblocks commands for a player.", usage = "/<command> <player>", aliases = "unblockcommand,unblockcommands,ubcmds,unblockcmds,ubc")
|
||||
public class Command_unblockcmd extends FreedomCommand
|
||||
{
|
||||
|
@ -1,14 +1,12 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(rank = Rank.ADMIN, source = SourceType.BOTH)
|
||||
@CommandPermissions(permission = "uncage", source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Uncage a player", usage = "/<command> <name>")
|
||||
public class Command_uncage extends FreedomCommand
|
||||
{
|
||||
|
@ -1,12 +1,11 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
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(rank = Rank.ADMIN, source = SourceType.BOTH)
|
||||
@CommandPermissions(permission = "undisguiseall", source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Undisguise all online players on the server", usage = "/<command> [-a]", aliases = "uall")
|
||||
public class Command_undisguiseall extends FreedomCommand
|
||||
{
|
||||
|
@ -1,14 +1,12 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.player.PlayerData;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(rank = Rank.OP, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandPermissions(permission = "unlinkdiscord", source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "Unlink your Discord account from your Minecraft account", usage = "/<command> [player]")
|
||||
public class Command_unlinkdiscord extends FreedomCommand
|
||||
{
|
||||
@ -22,7 +20,7 @@ public class Command_unlinkdiscord extends FreedomCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
if (args.length != 0 && plugin.al.isAdmin(playerSender))
|
||||
if (args.length != 0 && sender.hasPermission("tfm.unlinkdiscord.other"))
|
||||
{
|
||||
PlayerData playerData = plugin.pl.getData(args[0]);
|
||||
if (playerData == null)
|
||||
|
@ -1,16 +1,14 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(rank = Rank.ADMIN, source = SourceType.BOTH)
|
||||
@CommandPermissions(permission = "unmute", source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Unmutes a player", usage = "/<command> [-q] <player>")
|
||||
public class Command_unmute extends FreedomCommand
|
||||
{
|
||||
|
@ -3,20 +3,17 @@ package me.totalfreedom.totalfreedommod.command;
|
||||
import me.totalfreedom.totalfreedommod.admin.AdminList;
|
||||
import me.totalfreedom.totalfreedommod.player.PlayerData;
|
||||
import me.totalfreedom.totalfreedommod.rank.Displayable;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
@CommandPermissions(rank = Rank.ADMIN, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandPermissions(permission = "vanish", source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "Vanish/unvanish yourself.", usage = "/<command> [-s[ilent]]", aliases = "v")
|
||||
public class Command_vanish extends FreedomCommand
|
||||
{
|
||||
|
@ -2,16 +2,13 @@ package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import java.util.List;
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(rank = Rank.OP, source = SourceType.BOTH)
|
||||
@CommandPermissions(permission = "vote", source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Information on how to vote", usage = "/<command>")
|
||||
public class Command_vote extends FreedomCommand
|
||||
{
|
||||
|
@ -2,22 +2,15 @@ package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.punishments.Punishment;
|
||||
import me.totalfreedom.totalfreedommod.punishments.PunishmentType;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import net.kyori.adventure.title.Title;
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.time.Duration;
|
||||
|
||||
@CommandPermissions(rank = Rank.ADMIN, source = SourceType.BOTH)
|
||||
@CommandPermissions(permission = "warn", source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Warns the specified player.", usage = "/<command> [-q] <player> <reason>")
|
||||
public class Command_warn extends FreedomCommand
|
||||
{
|
||||
|
@ -4,9 +4,7 @@ import java.util.*;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@ -64,7 +62,7 @@ public class Command_whitelist extends FreedomCommand
|
||||
}
|
||||
|
||||
// Commands below are restricted to admins
|
||||
checkRank(Rank.ADMIN);
|
||||
checkPermission(Rank.ADMIN);
|
||||
|
||||
// on
|
||||
if (args[0].equalsIgnoreCase("on"))
|
||||
@ -153,7 +151,7 @@ public class Command_whitelist extends FreedomCommand
|
||||
|
||||
// Telnet only
|
||||
checkConsole();
|
||||
checkRank(Rank.ADMIN);
|
||||
checkPermission(Rank.ADMIN);
|
||||
|
||||
// purge
|
||||
if (args[0].equalsIgnoreCase("purge"))
|
||||
|
@ -1,11 +1,5 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.Material;
|
||||
@ -14,7 +8,11 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.HumanEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(rank = Rank.OP, source = SourceType.BOTH)
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@CommandPermissions(permission = "whohas", source = SourceType.BOTH)
|
||||
@CommandParameters(description = "See who has an item and optionally clear the specified item.", usage = "/<command> <item> [clear]", aliases = "wh")
|
||||
public class Command_whohas extends FreedomCommand
|
||||
{
|
||||
@ -49,8 +47,7 @@ public class Command_whohas extends FreedomCommand
|
||||
if (players.isEmpty())
|
||||
{
|
||||
msgNew("There are no players with that item.");
|
||||
}
|
||||
else
|
||||
} else
|
||||
{
|
||||
msgNew("Players with item <type>: <players>", Placeholder.unparsed("type", material.name()),
|
||||
Placeholder.unparsed("players", StringUtils.join(players.stream().map(HumanEntity::getName).toList(), ", ")));
|
||||
|
@ -5,15 +5,13 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(rank = Rank.ADMIN, source = SourceType.BOTH, blockHostConsole = true)
|
||||
@CommandPermissions(permission = "wildcard", source = SourceType.BOTH, blockHostConsole = true)
|
||||
@CommandParameters(description = "Run any command on all users, username placeholder = ?.", usage = "/<command> [fluff] ? [fluff] ?")
|
||||
public class Command_wildcard extends FreedomCommand
|
||||
{
|
||||
|
@ -4,9 +4,9 @@ import com.google.common.collect.Lists;
|
||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||
import me.totalfreedom.totalfreedommod.admin.Admin;
|
||||
import me.totalfreedom.totalfreedommod.player.PlayerData;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import me.totalfreedom.totalfreedommod.util.PermissibleCompletion;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver;
|
||||
@ -42,7 +42,6 @@ public abstract class FreedomCommand implements CommandExecutor, TabCompleter
|
||||
private final String description;
|
||||
private final String usage;
|
||||
private final String aliases;
|
||||
private final Rank rank;
|
||||
private final String permission;
|
||||
private final SourceType source;
|
||||
private final boolean blockHostConsole;
|
||||
@ -65,20 +64,19 @@ public abstract class FreedomCommand implements CommandExecutor, TabCompleter
|
||||
this.description = params.description();
|
||||
this.usage = params.usage();
|
||||
this.aliases = params.aliases();
|
||||
this.rank = perms.rank();
|
||||
this.source = perms.source();
|
||||
this.blockHostConsole = perms.blockHostConsole();
|
||||
this.cooldown = perms.cooldown();
|
||||
this.permission = perms.rank().getPermission();
|
||||
this.permission = "tfm." + perms.permission();
|
||||
}
|
||||
|
||||
public static FreedomCommand getFrom(Command command)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (command instanceof FCommand)
|
||||
if (command instanceof FCommand cmd)
|
||||
{
|
||||
return ((FCommand) command).getExecutor();
|
||||
return cmd.getExecutor();
|
||||
}
|
||||
} catch (Exception ex)
|
||||
{
|
||||
@ -104,9 +102,9 @@ public abstract class FreedomCommand implements CommandExecutor, TabCompleter
|
||||
{
|
||||
cmd.setUsage(this.usage);
|
||||
}
|
||||
if (this.rank != null)
|
||||
if (this.permission != null)
|
||||
{
|
||||
cmd.setPermission(this.rank.getPermission());
|
||||
cmd.setPermission(this.permission);
|
||||
}
|
||||
server.getCommandMap().register("totalfreedommod", cmd);
|
||||
cmd.setExecutor(this);
|
||||
@ -151,6 +149,23 @@ public abstract class FreedomCommand implements CommandExecutor, TabCompleter
|
||||
msg(color + message);
|
||||
}
|
||||
|
||||
protected List<String> argumentCompletions(String arg, PermissibleCompletion... completions)
|
||||
{
|
||||
return Arrays.stream(completions)
|
||||
.filter(permissibleCompletion -> sender.hasPermission(permissibleCompletion.getPermission())) //Permission
|
||||
.map(PermissibleCompletion::getCompletion)
|
||||
.filter(completion -> completion.startsWith(arg))
|
||||
.toList();
|
||||
}
|
||||
|
||||
protected List<String> playerCompletions(String arg) {
|
||||
return Bukkit.getOnlinePlayers()
|
||||
.stream()
|
||||
.map(Player::getName)
|
||||
.filter(c -> c.startsWith(arg))
|
||||
.toList();
|
||||
}
|
||||
|
||||
protected boolean isAdmin(Player player)
|
||||
{
|
||||
return plugin.al.isAdmin(player);
|
||||
@ -177,9 +192,9 @@ public abstract class FreedomCommand implements CommandExecutor, TabCompleter
|
||||
}
|
||||
}
|
||||
|
||||
protected void checkRank(Rank rank)
|
||||
protected void checkPermission(String permission)
|
||||
{
|
||||
if (!plugin.rm.getRank(sender).isAtLeast(rank))
|
||||
if (!sender.hasPermission(permission))
|
||||
{
|
||||
noPerms();
|
||||
}
|
||||
@ -290,9 +305,9 @@ public abstract class FreedomCommand implements CommandExecutor, TabCompleter
|
||||
return aliases;
|
||||
}
|
||||
|
||||
public Rank getRank()
|
||||
public String getPermission()
|
||||
{
|
||||
return rank;
|
||||
return permission;
|
||||
}
|
||||
|
||||
public SourceType getSource()
|
||||
@ -334,11 +349,6 @@ public abstract class FreedomCommand implements CommandExecutor, TabCompleter
|
||||
|
||||
cmd.sender = sender;
|
||||
|
||||
if (cooldownCheck())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (checkCommandSource())
|
||||
{
|
||||
return true;
|
||||
@ -349,6 +359,11 @@ public abstract class FreedomCommand implements CommandExecutor, TabCompleter
|
||||
return true;
|
||||
}
|
||||
|
||||
if (cooldownCheck())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
assignApplicableCooldown();
|
||||
|
||||
return cmd.onCommand(sender, this, commandLabel, args);
|
||||
@ -373,7 +388,7 @@ public abstract class FreedomCommand implements CommandExecutor, TabCompleter
|
||||
|
||||
public boolean permissionCheck()
|
||||
{
|
||||
if (!sender.hasPermission(permission))
|
||||
if (!sender.hasPermission(permission) || !(sender instanceof ConsoleCommandSender))
|
||||
{
|
||||
msg(ChatColor.RED + "You do not have permission to use this command.");
|
||||
return true;
|
||||
|
@ -50,7 +50,6 @@ public class FPlayer
|
||||
private boolean lockedUp = false;
|
||||
private boolean inAdminchat = false;
|
||||
private boolean allCommandsBlocked = false;
|
||||
private String lastCommand = "";
|
||||
private String tag = null;
|
||||
private int warningCount = 0;
|
||||
|
||||
@ -336,16 +335,6 @@ public class FPlayer
|
||||
this.allCommandsBlocked = commandsBlocked;
|
||||
}
|
||||
|
||||
public String getLastCommand()
|
||||
{
|
||||
return lastCommand;
|
||||
}
|
||||
|
||||
public void setLastCommand(String lastCommand)
|
||||
{
|
||||
this.lastCommand = lastCommand;
|
||||
}
|
||||
|
||||
public String getTag()
|
||||
{
|
||||
return this.tag;
|
||||
|
@ -0,0 +1,141 @@
|
||||
package me.totalfreedom.totalfreedommod.rank;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||
import net.luckperms.api.model.group.Group;
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public class DisplayableGroup implements Displayable
|
||||
{
|
||||
private final Group group;
|
||||
|
||||
private final String name;
|
||||
|
||||
private final String abbr;
|
||||
private final String plural;
|
||||
private final String article;
|
||||
|
||||
private final String tag;
|
||||
|
||||
private final String coloredTag;
|
||||
|
||||
private final ChatColor color;
|
||||
|
||||
private final org.bukkit.ChatColor teamColor;
|
||||
|
||||
private final boolean hasTeam;
|
||||
|
||||
private final boolean hasDefaultLoginMessage;
|
||||
|
||||
public DisplayableGroup(String group,
|
||||
String plural,
|
||||
String tag,
|
||||
ChatColor color,
|
||||
org.bukkit.ChatColor teamColor,
|
||||
boolean hasTeam,
|
||||
boolean hasDefaultLoginMessage)
|
||||
{
|
||||
Group matched = TotalFreedomMod.getPlugin().lpb.getAPI().getGroupManager().getGroup(group);
|
||||
|
||||
if (matched == null) {
|
||||
throw new IllegalArgumentException("Group " + group + " does not exist!");
|
||||
}
|
||||
|
||||
this.group = matched;
|
||||
this.name = (matched.getDisplayName() != null) ? matched.getDisplayName() : matched.getName();
|
||||
this.plural = plural;
|
||||
this.article = StringUtils.startsWithAny(this.name.toLowerCase(Locale.ROOT), new String[]{"a", "e", "i", "o", "u"}) ? "an" : "a";
|
||||
this.abbr = tag;
|
||||
this.tag = "[" + tag + "]";
|
||||
this.color = color;
|
||||
this.teamColor = teamColor;
|
||||
this.hasTeam = hasTeam;
|
||||
this.coloredTag = ChatColor.DARK_GRAY + "[" + getColor() + getTag() + ChatColor.DARK_GRAY + "]" + getColor();
|
||||
this.hasDefaultLoginMessage = hasDefaultLoginMessage;
|
||||
}
|
||||
|
||||
public boolean isAtLeast(@NotNull DisplayableGroup rank)
|
||||
{
|
||||
return rank.getLuckPermsGroup().getWeight().orElse(0)
|
||||
<= getLuckPermsGroup().getWeight().orElse(0);
|
||||
}
|
||||
|
||||
public Group getLuckPermsGroup() {
|
||||
return this.group;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArticle()
|
||||
{
|
||||
return this.article;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTag()
|
||||
{
|
||||
return tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAbbr()
|
||||
{
|
||||
return abbr;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPlural()
|
||||
{
|
||||
return plural;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChatColor getColor()
|
||||
{
|
||||
return color;
|
||||
}
|
||||
|
||||
@Override
|
||||
public org.bukkit.ChatColor getTeamColor()
|
||||
{
|
||||
return teamColor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getColoredName()
|
||||
{
|
||||
return color + name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getColoredTag()
|
||||
{
|
||||
return coloredTag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getColoredLoginMessage()
|
||||
{
|
||||
return article + ' ' + color + name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTeam()
|
||||
{
|
||||
return hasTeam;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasDefaultLoginMessage()
|
||||
{
|
||||
return hasDefaultLoginMessage;
|
||||
}
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package me.totalfreedom.totalfreedommod.rank;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||
import net.luckperms.api.model.user.User;
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@FunctionalInterface
|
||||
public interface GroupProvider<T extends DisplayableGroup>
|
||||
{
|
||||
GroupProvider<DisplayableGroup> NON_OP = () -> new DisplayableGroup("non_op", "Non-Ops", "", ChatColor.WHITE, null, false, false);
|
||||
GroupProvider<DisplayableGroup> OP = () -> new DisplayableGroup("op", "Operators", "Op", ChatColor.GREEN, null, false, false);
|
||||
GroupProvider<DisplayableGroup> ADMIN = () -> new DisplayableGroup("admin", "Administrators", "Admin", ChatColor.DARK_GREEN, org.bukkit.ChatColor.DARK_GREEN, true, true);
|
||||
GroupProvider<DisplayableGroup> SENIOR_ADMIN = () -> new DisplayableGroup("senior", "Senior Administrators", "SrA", ChatColor.GOLD, org.bukkit.ChatColor.GOLD, true, true);
|
||||
|
||||
static User getUser(Player player)
|
||||
{
|
||||
return TotalFreedomMod.getPlugin()
|
||||
.lpb.getAPI()
|
||||
.getPlayerAdapter(Player.class)
|
||||
.getUser(player);
|
||||
}
|
||||
|
||||
T getGroup();
|
||||
|
||||
static GroupProvider<DisplayableGroup> fromArgument(String arg) {
|
||||
return switch (arg.toLowerCase())
|
||||
{
|
||||
case "op" -> OP;
|
||||
case "admin" -> ADMIN;
|
||||
case "senior" -> SENIOR_ADMIN;
|
||||
default -> NON_OP;
|
||||
};
|
||||
}
|
||||
}
|
@ -1,196 +0,0 @@
|
||||
package me.totalfreedom.totalfreedommod.rank;
|
||||
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public enum Rank implements Displayable
|
||||
{
|
||||
NON_OP("a", "Non-Op", "tfm.default", "", "Non-Ops", ChatColor.WHITE, null, false, false),
|
||||
OP("an", "Operator", "tfm.op", "OP", "Operators", ChatColor.GREEN, null, false, false),
|
||||
ADMIN("an", "Admin", "tfm.admin", "Admin", "Administrators", ChatColor.DARK_GREEN, org.bukkit.ChatColor.DARK_GREEN, true, true),
|
||||
SENIOR_ADMIN("a", "Senior Admin", "tfm.senior", "SrA", "Senior Administrators", ChatColor.GOLD, org.bukkit.ChatColor.GOLD, true, true),
|
||||
ADMIN_CONSOLE("the", "Console", "tfm.rcon", "Console", "Administrator Consoles", ChatColor.DARK_PURPLE, null, false, false),
|
||||
SENIOR_CONSOLE("the", "Console", "tfm.rcon.senior", "Console", "Senior Consoles", ChatColor.DARK_PURPLE, null, false, false);
|
||||
|
||||
private final String permission;
|
||||
|
||||
private final String name;
|
||||
|
||||
private final String abbr;
|
||||
private final String plural;
|
||||
private final String article;
|
||||
|
||||
private final String tag;
|
||||
|
||||
private final String coloredTag;
|
||||
|
||||
private final ChatColor color;
|
||||
|
||||
private final org.bukkit.ChatColor teamColor;
|
||||
|
||||
private final boolean hasTeam;
|
||||
|
||||
private final boolean hasDefaultLoginMessage;
|
||||
|
||||
Rank(String article, String name, String permission, String abbr, String plural, ChatColor color, org.bukkit.ChatColor teamColor, Boolean hasTeam, Boolean hasDefaultLoginMessage)
|
||||
{
|
||||
this.permission = permission;
|
||||
this.name = name;
|
||||
this.abbr = abbr;
|
||||
this.plural = plural;
|
||||
this.article = article;
|
||||
this.tag = abbr.isEmpty() ? "" : "[" + abbr + "]";
|
||||
this.coloredTag = abbr.isEmpty() ? "" : ChatColor.DARK_GRAY + "[" + color + abbr + ChatColor.DARK_GRAY + "]" + color;
|
||||
this.color = color;
|
||||
this.teamColor = teamColor;
|
||||
this.hasTeam = hasTeam;
|
||||
this.hasDefaultLoginMessage = hasDefaultLoginMessage;
|
||||
}
|
||||
|
||||
public static Rank findRank(String string)
|
||||
{
|
||||
try
|
||||
{
|
||||
return Rank.valueOf(string.toUpperCase());
|
||||
} catch (Exception ignored)
|
||||
{
|
||||
}
|
||||
|
||||
return Rank.NON_OP;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getColoredName()
|
||||
{
|
||||
return color + name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getColoredLoginMessage()
|
||||
{
|
||||
return article + " " + color + name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTeam()
|
||||
{
|
||||
return hasTeam;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasDefaultLoginMessage()
|
||||
{
|
||||
return hasDefaultLoginMessage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAbbr()
|
||||
{
|
||||
return abbr;
|
||||
}
|
||||
|
||||
public String getPlural()
|
||||
{
|
||||
return plural;
|
||||
}
|
||||
|
||||
public boolean isConsole()
|
||||
{
|
||||
return getPermission().equalsIgnoreCase("tfm.rcon") ||
|
||||
getPermission().equalsIgnoreCase("tfm.rcon.senior"); // check for either console.
|
||||
}
|
||||
|
||||
public int getLevel()
|
||||
{
|
||||
return ordinal();
|
||||
}
|
||||
|
||||
public boolean isAtLeast(@NotNull Rank rank)
|
||||
{
|
||||
if (getLevel() < rank.getLevel())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!hasConsoleVariant() || !rank.hasConsoleVariant())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
assert getConsoleVariant() != null;
|
||||
assert rank.getConsoleVariant() != null;
|
||||
return getConsoleVariant().getLevel() >= rank.getConsoleVariant().getLevel();
|
||||
}
|
||||
|
||||
public boolean isAdmin()
|
||||
{
|
||||
return getPermission().equalsIgnoreCase("tfm.admin") ||
|
||||
getPermission().equalsIgnoreCase("tfm.rcon");
|
||||
}
|
||||
|
||||
public boolean hasConsoleVariant()
|
||||
{
|
||||
return getConsoleVariant() != null;
|
||||
}
|
||||
|
||||
public Rank getConsoleVariant()
|
||||
{
|
||||
return switch (this)
|
||||
{
|
||||
case ADMIN, ADMIN_CONSOLE -> ADMIN_CONSOLE;
|
||||
case SENIOR_ADMIN, SENIOR_CONSOLE -> SENIOR_CONSOLE;
|
||||
default -> null;
|
||||
};
|
||||
}
|
||||
|
||||
public String getPermission()
|
||||
{
|
||||
return permission;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArticle()
|
||||
{
|
||||
return article;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTag()
|
||||
{
|
||||
return tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getColoredTag()
|
||||
{
|
||||
return coloredTag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChatColor getColor()
|
||||
{
|
||||
return color;
|
||||
}
|
||||
|
||||
@Override
|
||||
public org.bukkit.ChatColor getTeamColor()
|
||||
{
|
||||
return teamColor;
|
||||
}
|
||||
|
||||
public boolean isHasTeam()
|
||||
{
|
||||
return hasTeam;
|
||||
}
|
||||
|
||||
public boolean isHasDefaultLoginMessage()
|
||||
{
|
||||
return hasDefaultLoginMessage;
|
||||
}
|
||||
}
|
@ -1,15 +1,16 @@
|
||||
package me.totalfreedom.totalfreedommod.rank;
|
||||
|
||||
import java.util.Objects;
|
||||
import me.totalfreedom.totalfreedommod.FreedomService;
|
||||
import me.totalfreedom.totalfreedommod.admin.Admin;
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||
import me.totalfreedom.totalfreedommod.player.PlayerData;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.luckperms.api.model.group.Group;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.ConsoleCommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
@ -17,6 +18,8 @@ import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.scoreboard.Scoreboard;
|
||||
import org.bukkit.scoreboard.Team;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class RankManager extends FreedomService
|
||||
{
|
||||
@Override
|
||||
@ -31,30 +34,29 @@ public class RankManager extends FreedomService
|
||||
|
||||
public Displayable getDisplay(CommandSender sender)
|
||||
{
|
||||
if (!(sender instanceof Player))
|
||||
if (!(sender instanceof Player player))
|
||||
{
|
||||
return getRank(sender); // Consoles don't have display ranks
|
||||
}
|
||||
|
||||
final Player player = (Player)sender;
|
||||
|
||||
// If the player's an owner, display that
|
||||
if (ConfigEntry.SERVER_OWNERS.getList().contains(player.getName()))
|
||||
{
|
||||
return Title.OWNER;
|
||||
}
|
||||
|
||||
// Developers always show up
|
||||
// If the user is an executive, display that.
|
||||
if (ConfigEntry.SERVER_EXECUTIVES.getList().contains(player.getName()) && plugin.al.isAdmin(player))
|
||||
{
|
||||
return Title.EXECUTIVE;
|
||||
}
|
||||
|
||||
// Developers always show up after executive.
|
||||
if (FUtil.isDeveloper(player))
|
||||
{
|
||||
return Title.DEVELOPER;
|
||||
}
|
||||
|
||||
if (ConfigEntry.SERVER_EXECUTIVES.getList().contains(player.getName()) && plugin.al.isAdmin(player))
|
||||
{
|
||||
return Title.EXECUTIVE;
|
||||
}
|
||||
|
||||
if (ConfigEntry.SERVER_ASSISTANT_EXECUTIVES.getList().contains(player.getName()) && plugin.al.isAdmin(player))
|
||||
{
|
||||
return Title.ASSTEXEC;
|
||||
@ -78,7 +80,7 @@ public class RankManager extends FreedomService
|
||||
}
|
||||
|
||||
// Developers always show up
|
||||
if (FUtil.isDeveloper((Player)admin))
|
||||
if (FUtil.isDeveloper((Player) admin))
|
||||
{
|
||||
return Title.DEVELOPER;
|
||||
}
|
||||
@ -91,17 +93,22 @@ public class RankManager extends FreedomService
|
||||
return admin.getRank();
|
||||
}
|
||||
|
||||
public Rank getRank(CommandSender sender)
|
||||
public DisplayableGroup getRank(CommandSender sender)
|
||||
{
|
||||
if (sender instanceof Player)
|
||||
if (sender instanceof Player player)
|
||||
{
|
||||
return getRank((Player)sender);
|
||||
return getRank(player);
|
||||
}
|
||||
|
||||
// CONSOLE?
|
||||
if (sender.getName().equals("CONSOLE"))
|
||||
if (sender instanceof ConsoleCommandSender console)
|
||||
{
|
||||
return ConfigEntry.ADMINLIST_CONSOLE_IS_ADMIN.getBoolean() ? Rank.SENIOR_CONSOLE : Rank.ADMIN_CONSOLE;
|
||||
if (sender.getName().equalsIgnoreCase("CONSOLE"))
|
||||
{
|
||||
return ConfigEntry.ADMINLIST_CONSOLE_IS_ADMIN.getBoolean()
|
||||
? GroupProvider.SENIOR_ADMIN.getGroup()
|
||||
: GroupProvider.ADMIN.getGroup();
|
||||
}
|
||||
}
|
||||
|
||||
// Console admin, get by name
|
||||
@ -110,20 +117,13 @@ public class RankManager extends FreedomService
|
||||
// Unknown console: RCON?
|
||||
if (admin == null)
|
||||
{
|
||||
return Rank.SENIOR_CONSOLE;
|
||||
return GroupProvider.SENIOR_ADMIN.getGroup();
|
||||
}
|
||||
|
||||
Rank rank = admin.getRank();
|
||||
|
||||
// Get console
|
||||
if (rank.hasConsoleVariant())
|
||||
{
|
||||
rank = rank.getConsoleVariant();
|
||||
}
|
||||
return rank;
|
||||
return admin.getRank();
|
||||
}
|
||||
|
||||
public Rank getRank(Player player)
|
||||
public DisplayableGroup getRank(Player player)
|
||||
{
|
||||
final Admin entry = plugin.al.getAdmin(player);
|
||||
if (entry != null)
|
||||
@ -131,7 +131,13 @@ public class RankManager extends FreedomService
|
||||
return entry.getRank();
|
||||
}
|
||||
|
||||
return player.isOp() ? Rank.OP : Rank.NON_OP;
|
||||
return plugin.lpb.getAPI()
|
||||
.getPlayerAdapter(Player.class)
|
||||
.getUser(player)
|
||||
.getPrimaryGroup()
|
||||
.equalsIgnoreCase("op")
|
||||
? GroupProvider.OP.getGroup()
|
||||
: GroupProvider.NON_OP.getGroup();
|
||||
}
|
||||
|
||||
public String getTag(Player player, String defaultTag)
|
||||
@ -161,8 +167,7 @@ public class RankManager extends FreedomService
|
||||
{
|
||||
String displayName = display.getColor() + player.getName();
|
||||
player.setPlayerListName(displayName);
|
||||
}
|
||||
else
|
||||
} else
|
||||
{
|
||||
fPlayer.setTag(null);
|
||||
player.setPlayerListName(null);
|
||||
@ -218,8 +223,7 @@ public class RankManager extends FreedomService
|
||||
if (playerData.hasLoginMessage())
|
||||
{
|
||||
message = playerData.getLoginMessage();
|
||||
}
|
||||
else
|
||||
} else
|
||||
{
|
||||
if (display.hasDefaultLoginMessage())
|
||||
{
|
||||
|
@ -0,0 +1,28 @@
|
||||
package me.totalfreedom.totalfreedommod.util;
|
||||
|
||||
public class PermissibleCompletion
|
||||
{
|
||||
private final String permission;
|
||||
private final String completion;
|
||||
|
||||
public PermissibleCompletion(String permission, String completion)
|
||||
{
|
||||
this.completion = completion;
|
||||
this.permission = permission;
|
||||
}
|
||||
|
||||
public String getPermission()
|
||||
{
|
||||
return permission;
|
||||
}
|
||||
|
||||
public String getCompletion()
|
||||
{
|
||||
return completion;
|
||||
}
|
||||
|
||||
public static PermissibleCompletion of(String permission, String completion)
|
||||
{
|
||||
return new PermissibleCompletion(permission, completion);
|
||||
}
|
||||
}
|
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>me.totalfreedom</groupId>
|
||||
<artifactId>TotalFreedomMod</artifactId>
|
||||
<version>2023.02</version>
|
||||
<version>2023.03</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>discord</artifactId>
|
||||
@ -27,7 +27,7 @@
|
||||
<dependency>
|
||||
<groupId>me.totalfreedom</groupId>
|
||||
<artifactId>commons</artifactId>
|
||||
<version>2023.02</version>
|
||||
<version>2023.03</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@ -36,11 +36,5 @@
|
||||
<version>3.5.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>me.totalfreedom</groupId>
|
||||
<artifactId>commons</artifactId>
|
||||
<version>2023.02</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
2
pom.xml
2
pom.xml
@ -5,7 +5,7 @@
|
||||
|
||||
<groupId>me.totalfreedom</groupId>
|
||||
<artifactId>TotalFreedomMod</artifactId>
|
||||
<version>2023.02</version>
|
||||
<version>2023.03</version>
|
||||
<packaging>pom</packaging>
|
||||
<modules>
|
||||
<module>commons</module>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>me.totalfreedom</groupId>
|
||||
<artifactId>TotalFreedomMod</artifactId>
|
||||
<version>2023.02</version>
|
||||
<version>2023.03</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>shop</artifactId>
|
||||
@ -15,7 +15,7 @@
|
||||
<dependency>
|
||||
<groupId>me.totalfreedom</groupId>
|
||||
<artifactId>commons</artifactId>
|
||||
<version>2023.02</version>
|
||||
<version>2023.03</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
Loading…
Reference in New Issue
Block a user