my end of the bargain

This commit is contained in:
Ivan 2021-02-25 16:42:30 -05:00
parent 3b666f1fde
commit 0367d9fd3a
22 changed files with 1221 additions and 1158 deletions

View File

@ -156,7 +156,7 @@
<dependency> <dependency>
<groupId>org.spigotmc</groupId> <groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId> <artifactId>spigot</artifactId>
<version>1.16.4-R0.1-SNAPSHOT</version> <version>1.16.5-R0.1-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>

View File

@ -30,6 +30,7 @@ public class LoginProcess extends FreedomService
private static boolean lockdownEnabled = false; private static boolean lockdownEnabled = false;
public List<String> TELEPORT_ON_JOIN = new ArrayList<>(); public List<String> TELEPORT_ON_JOIN = new ArrayList<>();
public List<String> CLEAR_ON_JOIN = new ArrayList<>(); public List<String> CLEAR_ON_JOIN = new ArrayList<>();
public List<String> CLOWNFISH_TOGGLE = new ArrayList<>();
public static boolean isLockdownEnabled() public static boolean isLockdownEnabled()
{ {

View File

@ -6,6 +6,7 @@ import org.bukkit.ChatColor;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import me.totalfreedom.totalfreedommod.LoginProcess;
@CommandPermissions(level = Rank.OP, source = SourceType.ONLY_IN_GAME) @CommandPermissions(level = Rank.OP, source = SourceType.ONLY_IN_GAME)
@CommandParameters(description = "Obtain a clown fish", usage = "/<command>") @CommandParameters(description = "Obtain a clown fish", usage = "/<command>")
@ -15,14 +16,14 @@ public class Command_clownfish extends FreedomCommand
@Override @Override
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
{ {
if (plugin.pl.getData(playerSender).hasItem(ShopItem.CLOWN_FISH)) if (plugin.pl.getData(playerSender).hasItem(ShopItem.CLOWN_FISH) && (!plugin.lp.CLOWNFISH_TOGGLE.contains(playerSender.getName())))
{ {
playerSender.getInventory().addItem(plugin.sh.getClownFish()); playerSender.getInventory().addItem(plugin.sh.getClownFish());
msg("You have been given a Clown Fish", ChatColor.GREEN); msg("You have been given a Clown Fish", ChatColor.GREEN);
} }
else else
{ {
msg("You do not own a Clown Fish! Purchase one from the shop.", ChatColor.RED); msg("You do not own a Clown Fish or an admin has toggled your ability to use it. Purchase one from the shop.", ChatColor.RED);
} }
return true; return true;
} }

View File

@ -21,8 +21,13 @@ public class Command_fuckoff extends FreedomCommand
FPlayer player = plugin.pl.getPlayer(playerSender); FPlayer player = plugin.pl.getPlayer(playerSender);
if (args[0].equalsIgnoreCase("off")) if (!args[0].equals("on"))
{ {
player.disableFuckoff();
}
else
{
double radius = 25.0; double radius = 25.0;
if (args.length >= 2) if (args.length >= 2)
{ {
@ -34,14 +39,12 @@ public class Command_fuckoff extends FreedomCommand
{ {
} }
} }
player.setFuckoff(radius); player.setFuckoff(radius);
} }
else
{
player.disableFuckoff();
}
msg("Fuckoff " + (player.isFuckOff() ? ("enabled. Radius: " + player.getFuckoffRadius() + ".") : "disabled.")); msg("Fuckoff " + (player.isFuckOff() ? ("enabled. Radius: " + player.getFuckoffRadius() + ".") : "disabled."));
return true; return true;
} }
} }

View File

@ -10,7 +10,7 @@ import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@CommandPermissions(level = Rank.SENIOR_ADMIN, source = SourceType.ONLY_CONSOLE) @CommandPermissions(level = Rank.ADMIN, source = SourceType.BOTH)
@CommandParameters(description = "Manage the shop", usage = "/<command> <coins: <add | set | remove> <amount> <player | all> | items: <give | take> <item> <player>", aliases = "ms") @CommandParameters(description = "Manage the shop", usage = "/<command> <coins: <add | set | remove> <amount> <player | all> | items: <give | take> <item> <player>", aliases = "ms")
public class Command_manageshop extends FreedomCommand public class Command_manageshop extends FreedomCommand
{ {

View File

@ -0,0 +1,36 @@
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(level = Rank.ADMIN, source = SourceType.BOTH)
@CommandParameters(description = "Toggle whether or not a player has the ability to use clownfish", usage = "/<command> <player>", aliases = "togglecf")
public class Command_toggleclownfish extends FreedomCommand
{
@Override
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
{
if (args.length == 0)
{
return false;
}
boolean enabled = plugin.lp.CLOWNFISH_TOGGLE.contains(args[0]);
if (enabled)
{
plugin.lp.CLOWNFISH_TOGGLE.remove(args[0]);
}
else
{
plugin.lp.CLOWNFISH_TOGGLE.add(args[0]);
}
msg(args[0] + " will " + (enabled ? "now" : "no longer") + " have the ability to use clownfish.");
return true;
}
}

View File

@ -57,6 +57,7 @@ public enum ConfigEntry
SERVER_LOGIN_SUBTITLE(String.class, "server.login_title.subtitle"), SERVER_LOGIN_SUBTITLE(String.class, "server.login_title.subtitle"),
SERVER_OWNERS(List.class, "server.owners"), SERVER_OWNERS(List.class, "server.owners"),
SERVER_EXECUTIVES(List.class, "server.executives"), SERVER_EXECUTIVES(List.class, "server.executives"),
SERVER_ASSTISTANT_EXECUTIVES(List.class, "server.assistant_executives"),
SERVER_MASTER_BUILDER_MANAGEMENT(List.class, "server.master_builder_management"), SERVER_MASTER_BUILDER_MANAGEMENT(List.class, "server.master_builder_management"),
SERVER_BAN_URL(String.class, "server.ban_url"), SERVER_BAN_URL(String.class, "server.ban_url"),
SERVER_INDEFBAN_URL(String.class, "server.indefban_url"), SERVER_INDEFBAN_URL(String.class, "server.indefban_url"),

View File

@ -403,6 +403,11 @@ public class Discord extends FreedomService
return; return;
} }
if (message.contains("§"))
{
message = StringUtils.remove(message, "§");
}
if (enabled && !chat_channel_id.isEmpty()) if (enabled && !chat_channel_id.isEmpty())
{ {
CompletableFuture<Message> sentMessage = Objects.requireNonNull(bot.getTextChannelById(chat_channel_id)).sendMessage(deformat(message)).submit(true); CompletableFuture<Message> sentMessage = Objects.requireNonNull(bot.getTextChannelById(chat_channel_id)).sendMessage(deformat(message)).submit(true);
@ -423,6 +428,11 @@ public class Discord extends FreedomService
return; return;
} }
if (message.contains("§"))
{
message = StringUtils.remove(message, "§");
}
if (enabled && !chat_channel_id.isEmpty()) if (enabled && !chat_channel_id.isEmpty())
{ {
CompletableFuture<Message> sentMessage = Objects.requireNonNull(bot.getTextChannelById(chat_channel_id)).sendMessage(deformat(message)).submit(true); CompletableFuture<Message> sentMessage = Objects.requireNonNull(bot.getTextChannelById(chat_channel_id)).sendMessage(deformat(message)).submit(true);

View File

@ -13,6 +13,7 @@ import me.totalfreedom.totalfreedommod.player.FPlayer;
import me.totalfreedom.totalfreedommod.player.PlayerData; import me.totalfreedom.totalfreedommod.player.PlayerData;
import me.totalfreedom.totalfreedommod.shop.ShopItem; import me.totalfreedom.totalfreedommod.shop.ShopItem;
import me.totalfreedom.totalfreedommod.util.FUtil; import me.totalfreedom.totalfreedommod.util.FUtil;
import me.totalfreedom.totalfreedommod.LoginProcess;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Color; import org.bukkit.Color;
import org.bukkit.FireworkEffect; import org.bukkit.FireworkEffect;
@ -248,6 +249,12 @@ public class ItemFun extends FreedomService
final int RADIUS_HIT = 5; final int RADIUS_HIT = 5;
final int STRENGTH = 4; final int STRENGTH = 4;
if (plugin.lp.CLOWNFISH_TOGGLE.contains(player.getName()))
{
player.sendMessage(ChatColor.GRAY + "An admin has disabled your ability to use clownfish.");
break;
}
if (!plugin.sh.isRealItem(plugin.pl.getData(player), ShopItem.CLOWN_FISH, player.getInventory(), plugin.sh.getClownFish())) if (!plugin.sh.isRealItem(plugin.pl.getData(player), ShopItem.CLOWN_FISH, player.getInventory(), plugin.sh.getClownFish()))
{ {
break; break;

View File

@ -8,8 +8,9 @@ public enum Title implements Displayable
MASTER_BUILDER("a", "Master Builder", ChatColor.DARK_AQUA, org.bukkit.ChatColor.DARK_AQUA, "MB", true, true), MASTER_BUILDER("a", "Master Builder", ChatColor.DARK_AQUA, org.bukkit.ChatColor.DARK_AQUA, "MB", true, true),
VERIFIED_ADMIN("a", "Verified Admin", ChatColor.LIGHT_PURPLE, org.bukkit.ChatColor.LIGHT_PURPLE, "VA", false, true), VERIFIED_ADMIN("a", "Verified Admin", ChatColor.LIGHT_PURPLE, org.bukkit.ChatColor.LIGHT_PURPLE, "VA", false, true),
EXECUTIVE("an", "Executive", ChatColor.RED, org.bukkit.ChatColor.RED, "Exec", true, true), EXECUTIVE("an", "Executive", ChatColor.RED, org.bukkit.ChatColor.RED, "Exec", true, true),
ASSTEXEC("an", "Assistant Executive", ChatColor.RED, org.bukkit.ChatColor.RED, "Asst Exec", true, true),
DEVELOPER("a", "Developer", ChatColor.DARK_PURPLE, org.bukkit.ChatColor.DARK_PURPLE, "Dev", true, true), DEVELOPER("a", "Developer", ChatColor.DARK_PURPLE, org.bukkit.ChatColor.DARK_PURPLE, "Dev", true, true),
OWNER("the", "Owner", ChatColor.of("#ff0000"), org.bukkit.ChatColor.DARK_RED, "Owner", true, true); OWNER("the", "Owner", ChatColor.DARK_RED, org.bukkit.ChatColor.DARK_RED, "Owner", true, true);
private final String article; private final String article;

View File

@ -136,7 +136,7 @@ public class FUtil
public static boolean isExecutive(String name) public static boolean isExecutive(String name)
{ {
return ConfigEntry.SERVER_OWNERS.getStringList().contains(name) || ConfigEntry.SERVER_EXECUTIVES.getStringList().contains(name); return ConfigEntry.SERVER_OWNERS.getStringList().contains(name) || ConfigEntry.SERVER_EXECUTIVES.getStringList().contains(name) || ConfigEntry.SERVER_ASSTISTANT_EXECUTIVES.getStringList().contains(name);
} }
public static boolean isDeveloper(Player player) public static boolean isDeveloper(Player player)

View File

@ -36,6 +36,9 @@ server:
# All players who show up as executive # All players who show up as executive
executives: [ ] executives: [ ]
# All players who show up as assistant executive
assistant_executives: []
# All those who can manage the master builder list # All those who can manage the master builder list
master_builder_management: [ ] master_builder_management: [ ]