mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-27 01:05:38 +00:00
bleh
This commit is contained in:
parent
3754222582
commit
93d4c9654e
@ -245,10 +245,9 @@ public class TotalFreedomMod extends AeroPlugin<TotalFreedomMod>
|
|||||||
btb = bridges.registerService(BukkitTelnetBridge.class);
|
btb = bridges.registerService(BukkitTelnetBridge.class);
|
||||||
cpb = bridges.registerService(CoreProtectBridge.class);
|
cpb = bridges.registerService(CoreProtectBridge.class);
|
||||||
esb = bridges.registerService(EssentialsBridge.class);
|
esb = bridges.registerService(EssentialsBridge.class);
|
||||||
// Disabled so I can at least load TFM as these plugins aren't updated
|
|
||||||
ldb = bridges.registerService(LibsDisguisesBridge.class);
|
ldb = bridges.registerService(LibsDisguisesBridge.class);
|
||||||
web = bridges.registerService(WorldEditBridge.class);
|
web = bridges.registerService(WorldEditBridge.class);
|
||||||
//wgb = bridges.registerService(WorldGuardBridge.class);
|
wgb = bridges.registerService(WorldGuardBridge.class);
|
||||||
amp = bridges.registerService(AMP.class);
|
amp = bridges.registerService(AMP.class);
|
||||||
bridges.start();
|
bridges.start();
|
||||||
|
|
||||||
|
@ -221,9 +221,9 @@ public class EventBlocker extends FreedomService
|
|||||||
{
|
{
|
||||||
BlockStateMeta blockStateMeta = (BlockStateMeta)item.getItemMeta();
|
BlockStateMeta blockStateMeta = (BlockStateMeta)item.getItemMeta();
|
||||||
ShulkerBox shulkerBox = (ShulkerBox)blockStateMeta.getBlockState();
|
ShulkerBox shulkerBox = (ShulkerBox)blockStateMeta.getBlockState();
|
||||||
for(ItemStack item : shulkerBox.getInventory().getContents)
|
for (ItemStack itemStack : shulkerBox.getInventory().getContents())
|
||||||
{
|
{
|
||||||
if(item != null)
|
if (itemStack != null)
|
||||||
{
|
{
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
break;
|
break;
|
||||||
|
@ -18,7 +18,7 @@ public class Command_admininfo 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)
|
||||||
{
|
{
|
||||||
List<String> adminInfo = ConfigEntry.ADMININFO.getStringList();
|
List<String> adminInfo = ConfigEntry.ADMIN_INFO.getStringList();
|
||||||
|
|
||||||
if (adminInfo.isEmpty())
|
if (adminInfo.isEmpty())
|
||||||
{
|
{
|
||||||
|
@ -7,8 +7,8 @@ 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.SUPER_ADMIN, source = SourceType.BOTH)
|
@CommandPermissions(level = Rank.OP, source = SourceType.BOTH)
|
||||||
@CommandParameters(description = "Quickly change your own gamemode to adventure, or define someone's username to change theirs.", usage = "/<command> <-a | [partialname]>", aliases = "gma")
|
@CommandParameters(description = "Quickly change your own gamemode to adventure, or define someone's username to change theirs.", usage = "/<command> <[partialname] | -a>", aliases = "gms")
|
||||||
public class Command_adventure extends FreedomCommand
|
public class Command_adventure extends FreedomCommand
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -28,6 +28,8 @@ public class Command_adventure extends FreedomCommand
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
checkRank(Rank.SUPER_ADMIN);
|
||||||
|
|
||||||
if (args[0].equals("-a"))
|
if (args[0].equals("-a"))
|
||||||
{
|
{
|
||||||
for (Player targetPlayer : server.getOnlinePlayers())
|
for (Player targetPlayer : server.getOnlinePlayers())
|
||||||
@ -47,10 +49,9 @@ public class Command_adventure extends FreedomCommand
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
msg("Setting " + player.getName() + " to game mode adventure");
|
msg("Setting " + player.getName() + " to game mode adventure.");
|
||||||
msg(player, sender.getName() + " set your game mode to adventure");
|
msg(player, sender.getName() + " set your game mode to adventure.");
|
||||||
player.setGameMode(GameMode.ADVENTURE);
|
player.setGameMode(GameMode.ADVENTURE);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,41 +11,61 @@ import org.bukkit.command.CommandSender;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
@CommandPermissions(level = Rank.OP, source = SourceType.BOTH)
|
@CommandPermissions(level = Rank.OP, source = SourceType.BOTH)
|
||||||
@CommandParameters(description = "Clear chat", usage = "/<command> [optout]", aliases = "cc")
|
@CommandParameters(description = "Clear chat", usage = "/<command>", aliases = "cc")
|
||||||
public class Command_clearchat extends FreedomCommand
|
public class Command_clearchat 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.al.isAdmin(playerSender))
|
if (plugin.al.isAdmin(playerSender))
|
||||||
{
|
{
|
||||||
server.getOnlinePlayers().stream().filter(player -> !plugin.al.isAdmin(player) || !plugin.pv.getVerificationPlayer(player).isClearChatOptOut() || !plugin.mbl.getMasterBuilder(player).isClearChatOptOut()).forEach(player -> IntStream.range(0, 100).mapToObj(i -> "").forEach(player::sendMessage));
|
for (Player player : server.getOnlinePlayers())
|
||||||
FUtil.adminAction(sender.getName(), "Cleared chat", true);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (args.length != 1)
|
|
||||||
{
|
{
|
||||||
return false;
|
boolean optedOut = false;
|
||||||
|
|
||||||
|
if (plugin.al.isAdmin(player))
|
||||||
|
{
|
||||||
|
optedOut = true;
|
||||||
}
|
}
|
||||||
if (plugin.mbl.isMasterBuilder(playerSender))
|
else if (plugin.mbl.isMasterBuilder(player) && plugin.mbl.getMasterBuilder(player).isClearChatOptOut())
|
||||||
|
{
|
||||||
|
optedOut = true;
|
||||||
|
}
|
||||||
|
else if (plugin.pv.getVerificationPlayer(player).getEnabled() && plugin.pv.getVerificationPlayer(player).isClearChatOptOut())
|
||||||
|
{
|
||||||
|
optedOut = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!optedOut)
|
||||||
|
{
|
||||||
|
IntStream.range(0, 100).mapToObj(i -> "").forEach(player::sendMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FUtil.adminAction(sender.getName(), "Cleared chat", true);
|
||||||
|
}
|
||||||
|
else if (plugin.mbl.isMasterBuilder(playerSender))
|
||||||
{
|
{
|
||||||
MasterBuilder mb = plugin.mbl.getMasterBuilder(playerSender);
|
MasterBuilder mb = plugin.mbl.getMasterBuilder(playerSender);
|
||||||
mb.setClearChatOptOut(!mb.isClearChatOptOut());
|
mb.setClearChatOptOut(!mb.isClearChatOptOut());
|
||||||
msg(mb.isClearChatOptOut() ? "Opted-out" : "Opted-in" + " to clear chat.");
|
msg((mb.isClearChatOptOut() ? "Opted-out of" : "Opted-in to") + " clear chat.");
|
||||||
plugin.mbl.save();
|
plugin.mbl.save();
|
||||||
plugin.mbl.updateTables();
|
plugin.mbl.updateTables();
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
if (plugin.pv.getVerificationPlayer(playerSender).getEnabled())
|
else if (plugin.pv.getVerificationPlayer(playerSender).getEnabled())
|
||||||
{
|
{
|
||||||
VPlayer vp = plugin.pv.getVerificationPlayer(playerSender);
|
VPlayer vp = plugin.pv.getVerificationPlayer(playerSender);
|
||||||
vp.setClearChatOptOut(!vp.isClearChatOptOut());
|
vp.setClearChatOptOut(!vp.isClearChatOptOut());
|
||||||
msg(vp.isClearChatOptOut() ? "Opted-out" : "Opted-in" + " to clear chat.");
|
msg((vp.isClearChatOptOut() ? "Opted-out of" : "Opted-in to") + " clear chat.");
|
||||||
plugin.pv.saveVerificationData(vp);
|
plugin.pv.saveVerificationData(vp);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
msg("Only Master Builders, and players with verification enabled can opt out of clear chat.", ChatColor.RED);
|
else
|
||||||
|
{
|
||||||
|
msg("Only Master Builders, admins, and players with verification enabled can opt-out of clear chat.", ChatColor.RED);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -41,6 +41,12 @@ public class Command_deop extends FreedomCommand
|
|||||||
|
|
||||||
player.setOp(false);
|
player.setOp(false);
|
||||||
|
|
||||||
|
if (player.isOnline())
|
||||||
|
{
|
||||||
|
Player p = (Player)player;
|
||||||
|
p.sendMessage(YOU_ARE_NOT_OP);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,34 @@
|
|||||||
|
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 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(level = Rank.OP, source = SourceType.BOTH)
|
||||||
|
@CommandParameters(description = "Information on how to apply for Master Builder.", usage = "/<command>", aliases = "mbi")
|
||||||
|
public class Command_masterbuilderinfo extends FreedomCommand
|
||||||
|
{
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||||
|
{
|
||||||
|
List<String> masterBuilderInfo = ConfigEntry.MASTER_BUILDER_INFO.getStringList();
|
||||||
|
|
||||||
|
if (masterBuilderInfo.isEmpty())
|
||||||
|
{
|
||||||
|
msg("There is no Master Builder information set in the config.", ChatColor.RED);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
msg(FUtil.colorize(StringUtils.join(masterBuilderInfo, "\n")));
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
@ -55,6 +55,12 @@ public class Command_op extends FreedomCommand
|
|||||||
FUtil.adminAction(sender.getName(), "Opping " + player.getName(), false);
|
FUtil.adminAction(sender.getName(), "Opping " + player.getName(), false);
|
||||||
player.setOp(true);
|
player.setOp(true);
|
||||||
|
|
||||||
|
if (player.isOnline())
|
||||||
|
{
|
||||||
|
Player p = (Player)player;
|
||||||
|
p.sendMessage(YOU_ARE_OP);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ public class Command_smite extends FreedomCommand
|
|||||||
{
|
{
|
||||||
FUtil.bcastMsg(" Reason: " + ChatColor.YELLOW + reason, ChatColor.RED);
|
FUtil.bcastMsg(" Reason: " + ChatColor.YELLOW + reason, ChatColor.RED);
|
||||||
}
|
}
|
||||||
FUtil.bcastMsg(" Smited by: " + ChatColor.YELLOW + sender.getName(), ChatColor.RED);
|
FUtil.bcastMsg(" Smitten by: " + ChatColor.YELLOW + sender.getName(), ChatColor.RED);
|
||||||
|
|
||||||
// Deop
|
// Deop
|
||||||
player.setOp(false);
|
player.setOp(false);
|
||||||
|
@ -95,7 +95,8 @@ public enum ConfigEntry
|
|||||||
OVERLORD_IPS(List.class, "overlord_ips"),
|
OVERLORD_IPS(List.class, "overlord_ips"),
|
||||||
NOADMIN_IPS(List.class, "noadmin_ips"),
|
NOADMIN_IPS(List.class, "noadmin_ips"),
|
||||||
ADMIN_ONLY_MODE(Boolean.class, "admin_only_mode"),
|
ADMIN_ONLY_MODE(Boolean.class, "admin_only_mode"),
|
||||||
ADMININFO(List.class, "admininfo"),
|
ADMIN_INFO(List.class, "admininfo"),
|
||||||
|
MASTER_BUILDER_INFO(List.class, "masterbuilderinfo"),
|
||||||
AUTO_ENTITY_WIPE(Boolean.class, "auto_wipe"),
|
AUTO_ENTITY_WIPE(Boolean.class, "auto_wipe"),
|
||||||
//
|
//
|
||||||
AMP_ENABLED(Boolean.class, "amp.enabled"),
|
AMP_ENABLED(Boolean.class, "amp.enabled"),
|
||||||
|
@ -84,7 +84,7 @@ public class MasterBuilder implements ConfigLoadable, ConfigSavable, Validatable
|
|||||||
lastLogin = FUtil.stringToDate(cs.getString("last_login"));
|
lastLogin = FUtil.stringToDate(cs.getString("last_login"));
|
||||||
discordID = cs.getString("discord_id", null);
|
discordID = cs.getString("discord_id", null);
|
||||||
tag = cs.getString("tag", null);
|
tag = cs.getString("tag", null);
|
||||||
clearChatOptOut = cs.getBoolean("clearchatoptout", false);
|
clearChatOptOut = cs.getBoolean("clearChatOptOut", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -96,7 +96,7 @@ public class MasterBuilder implements ConfigLoadable, ConfigSavable, Validatable
|
|||||||
cs.set("last_login", FUtil.dateToString(lastLogin));
|
cs.set("last_login", FUtil.dateToString(lastLogin));
|
||||||
cs.set("discord_id", discordID);
|
cs.set("discord_id", discordID);
|
||||||
cs.set("tag", tag);
|
cs.set("tag", tag);
|
||||||
cs.set("clearchatoptout", clearChatOptOut);
|
cs.set("clearChatOptOut", clearChatOptOut);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addIp(String ip)
|
public void addIp(String ip)
|
||||||
|
@ -54,7 +54,7 @@ public class VPlayer implements ConfigLoadable, ConfigSavable, Validatable
|
|||||||
discordId = cs.getString("discordId", null);
|
discordId = cs.getString("discordId", null);
|
||||||
enabled = cs.getBoolean("enabled", false);
|
enabled = cs.getBoolean("enabled", false);
|
||||||
tag = cs.getString("tag", null);
|
tag = cs.getString("tag", null);
|
||||||
clearChatOptOut = cs.getBoolean("clearchatoptout", false);
|
clearChatOptOut = cs.getBoolean("clearChatOptOut", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -66,7 +66,7 @@ public class VPlayer implements ConfigLoadable, ConfigSavable, Validatable
|
|||||||
cs.set("enabled", enabled);
|
cs.set("enabled", enabled);
|
||||||
cs.set("tag", tag);
|
cs.set("tag", tag);
|
||||||
cs.set("ips", Lists.newArrayList(ips));
|
cs.set("ips", Lists.newArrayList(ips));
|
||||||
cs.set("clearchatoptout", clearChatOptOut);
|
cs.set("clearChatOptOut", clearChatOptOut);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<String> getIps()
|
public List<String> getIps()
|
||||||
|
@ -287,6 +287,15 @@ admininfo:
|
|||||||
- ' &2- And apply on our forums at the link:'
|
- ' &2- And apply on our forums at the link:'
|
||||||
- ' &9www.totalfreedom.boards.net'
|
- ' &9www.totalfreedom.boards.net'
|
||||||
|
|
||||||
|
# What to display in the Master Builder info command.
|
||||||
|
masterbuilderinfo:
|
||||||
|
- '&bHow to apply for Master Builder on the TotalFreedom Server:'
|
||||||
|
- ' &6- Do not ask for Master Builder in game'
|
||||||
|
- ' &2- Screenshot some of your previous builds (be ready to prove that the builds are yours)'
|
||||||
|
- ' &6- Copy the template and create a thread on our forums'
|
||||||
|
- ' &2- Template:'
|
||||||
|
- ' &9bit.ly/TFMasterBuilderTemplate'
|
||||||
|
|
||||||
# Famous players - cannot be banned by username
|
# Famous players - cannot be banned by username
|
||||||
famous_players:
|
famous_players:
|
||||||
- honeydew
|
- honeydew
|
||||||
|
Loading…
Reference in New Issue
Block a user