OPs can now have persistent tags (#108)

* new high end piece of software

- refactor all the shit to isEnabled
- idk debug
- gotta keep the messages consistent
- worldedit 🅱️ roke
- lockup description
- add /nh as an alias for namehistory
- yo /setl actually checks for w/e now cool
- gtfo and unban now are less bugs
- /whitelist is no longer written in tfm43 code and in beta
- l a m b a d a in help
- enable the bridges
- i worked on a converter for the login messages but then seth already made it work so fuck me i wasted an hour of my life

* whitelist

* i enabled them for testing

* OPs can now have persistent tags!

* Summary (required)
This commit is contained in:
Telesphoreo 2018-07-30 00:23:01 -07:00 committed by Seth
parent 9c2f181ab9
commit 941bbc8da3
40 changed files with 165 additions and 193 deletions

View File

@ -52,7 +52,7 @@ public class AutoKick extends FreedomService
private void autoKickCheck() private void autoKickCheck()
{ {
final boolean doAwayKickCheck final boolean doAwayKickCheck
= plugin.esb.isEssentialsEnabled() = plugin.esb.isEnabled()
&& ((server.getOnlinePlayers().size() / server.getMaxPlayers()) > autoKickThreshold); && ((server.getOnlinePlayers().size() / server.getMaxPlayers()) > autoKickThreshold);
if (!doAwayKickCheck) if (!doAwayKickCheck)

View File

@ -177,5 +177,4 @@ public class ChatManager extends FreedomService
} }
} }
} }
} }

View File

@ -9,7 +9,6 @@ import org.bukkit.event.player.PlayerMoveEvent;
public class Fuckoff extends FreedomService public class Fuckoff extends FreedomService
{ {
public Fuckoff(TotalFreedomMod plugin) public Fuckoff(TotalFreedomMod plugin)
{ {
super(plugin); super(plugin);
@ -64,5 +63,4 @@ public class Fuckoff extends FreedomService
} }
} }
} }
} }

View File

@ -122,7 +122,6 @@ public class Admin implements ConfigLoadable, ConfigSavable, Validatable
acFormat = cs.getString("acformat", null); acFormat = cs.getString("acformat", null);
oldTags = cs.getBoolean("oldtags", false); oldTags = cs.getBoolean("oldtags", false);
logStick = cs.getBoolean("logstick", false); logStick = cs.getBoolean("logstick", false);
} }
@Override @Override

View File

@ -194,8 +194,6 @@ public class AdminList extends FreedomService
} }
return admin; return admin;
} }
// Impostor
} }
// Admin by ip // Admin by ip

View File

@ -1,26 +1,26 @@
package me.totalfreedom.totalfreedommod.bridge; package me.totalfreedom.totalfreedommod.bridge;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.inventory.InventoryCloseEvent;
import org.bukkit.event.EventPriority;
import org.bukkit.event.EventHandler;
import me.totalfreedom.totalfreedommod.rank.Rank;
import org.bukkit.inventory.InventoryHolder;
import me.totalfreedom.totalfreedommod.player.FPlayer;
import org.bukkit.inventory.Inventory;
import org.bukkit.scheduler.BukkitRunnable;
import org.bukkit.entity.HumanEntity;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryClickEvent;
import me.totalfreedom.totalfreedommod.util.FUtil;
import com.earth2me.essentials.User;
import org.bukkit.plugin.Plugin;
import me.totalfreedom.totalfreedommod.util.FLog;
import me.totalfreedom.totalfreedommod.command.Command_vanish;
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
import com.earth2me.essentials.Essentials; import com.earth2me.essentials.Essentials;
import com.earth2me.essentials.User;
import me.totalfreedom.totalfreedommod.FreedomService; import me.totalfreedom.totalfreedommod.FreedomService;
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
import me.totalfreedom.totalfreedommod.command.Command_vanish;
import me.totalfreedom.totalfreedommod.player.FPlayer;
import me.totalfreedom.totalfreedommod.rank.Rank;
import me.totalfreedom.totalfreedommod.util.FLog;
import me.totalfreedom.totalfreedommod.util.FUtil;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryCloseEvent;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.plugin.Plugin;
import org.bukkit.scheduler.BukkitRunnable;
public class EssentialsBridge extends FreedomService public class EssentialsBridge extends FreedomService
{ {
@ -221,20 +221,10 @@ public class EssentialsBridge extends FreedomService
} }
} }
public boolean isEssentialsEnabled() public boolean isEnabled()
{ {
try final Essentials ess = getEssentialsPlugin();
{
Essentials essentials = getEssentialsPlugin(); return ess != null && ess.isEnabled();
if (essentials != null)
{
return essentials.isEnabled();
}
}
catch (Exception ex)
{
FLog.severe(ex);
}
return false;
} }
} }

View File

@ -1,7 +1,6 @@
package me.totalfreedom.totalfreedommod.bridge; package me.totalfreedom.totalfreedommod.bridge;
import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.LocalSession;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.bukkit.BukkitPlayer; import com.sk89q.worldedit.bukkit.BukkitPlayer;
import com.sk89q.worldedit.bukkit.WorldEditPlugin; import com.sk89q.worldedit.bukkit.WorldEditPlugin;
import me.totalfreedom.totalfreedommod.FreedomService; import me.totalfreedom.totalfreedommod.FreedomService;
@ -159,21 +158,4 @@ public class WorldEditBridge extends FreedomService
return null; return null;
} }
} }
public boolean isWorldEditEnabled()
{
try
{
WorldEditPlugin worldedit = getWorldEditPlugin();
if (worldedit != null)
{
return worldedit.isEnabled();
}
}
catch (Exception ex)
{
FLog.severe(ex);
}
return false;
}
} }

View File

@ -32,7 +32,6 @@ public class WorldEditListener extends PluginListener<TotalFreedomMod>
event.getMaxVector(), event.getMaxVector(),
event.getWorld().getName())) event.getWorld().getName()))
{ {
player.sendMessage(ChatColor.RED + "The region that you selected contained a protected area. Selection cleared."); player.sendMessage(ChatColor.RED + "The region that you selected contained a protected area. Selection cleared.");
event.setCancelled(true); event.setCancelled(true);
} }

View File

@ -69,20 +69,10 @@ public class WorldGuardBridge extends FreedomService
return false; return false;
} }
public boolean isPluginEnabled() public boolean isEnabled()
{ {
try final WorldGuardPlugin wg = getWorldGuardPlugin();
{
WorldGuardPlugin wg = getWorldGuardPlugin(); return wg != null && wg.isEnabled();
if (wg != null)
{
return wg.isEnabled();
}
}
catch (Exception ex)
{
FLog.severe(ex);
}
return false;
} }
} }

View File

@ -29,7 +29,7 @@ public class Command_debug extends FreedomCommand
if (className.equalsIgnoreCase("_")) if (className.equalsIgnoreCase("_"))
{ {
className = "me.StevenLawson.TotalFreedomMod.TotalFreedomMod"; className = "me.totalfreedom.totalfreedommod.TotalFreedomMod";
} }
setStaticValue(className, fieldName, newValue); setStaticValue(className, fieldName, newValue);

View File

@ -14,7 +14,7 @@ public class Command_denick 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.esb.isEssentialsEnabled()) if (!plugin.esb.isEnabled())
{ {
msg("Essentials is not enabled on this server."); msg("Essentials is not enabled on this server.");
return true; return true;

View File

@ -18,7 +18,7 @@ public class Command_disguisetoggle extends FreedomCommand
{ {
if (!plugin.ldb.isEnabled()) if (!plugin.ldb.isEnabled())
{ {
msg(ChatColor.RED + "LibsDisguises is not enabled."); msg("LibsDisguises is not enabled.");
return true; return true;
} }

View File

@ -5,7 +5,6 @@ import me.totalfreedom.totalfreedommod.player.PlayerData;
import me.totalfreedom.totalfreedommod.punishments.Punishment; import me.totalfreedom.totalfreedommod.punishments.Punishment;
import me.totalfreedom.totalfreedommod.punishments.PunishmentType; import me.totalfreedom.totalfreedommod.punishments.PunishmentType;
import me.totalfreedom.totalfreedommod.rank.Rank; import me.totalfreedom.totalfreedommod.rank.Rank;
import me.totalfreedom.totalfreedommod.util.FLog;
import me.totalfreedom.totalfreedommod.util.FUtil; import me.totalfreedom.totalfreedommod.util.FUtil;
import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -104,12 +103,9 @@ public class Command_gtfo extends FreedomCommand
{ {
// Undo WorldEdits // Undo WorldEdits
try try
{
if (plugin.web.isWorldEditEnabled())
{ {
plugin.web.undo(player, 15); plugin.web.undo(player, 15);
} }
}
catch (NoClassDefFoundError | NullPointerException ex) catch (NoClassDefFoundError | NullPointerException ex)
{ {
} }

View File

@ -15,7 +15,6 @@ import org.bukkit.entity.Player;
@CommandParameters(description = "Kick a player.", usage = "/<command> <player> [reason]", aliases = "k") @CommandParameters(description = "Kick a player.", usage = "/<command> <player> [reason]", aliases = "k")
public class Command_kick extends FreedomCommand public class Command_kick extends FreedomCommand
{ {
@Override @Override
protected boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) protected boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
{ {
@ -25,6 +24,7 @@ public class Command_kick extends FreedomCommand
} }
Player player = getPlayer(args[0]); Player player = getPlayer(args[0]);
if (player == null) if (player == null)
{ {
msg(PLAYER_NOT_FOUND); msg(PLAYER_NOT_FOUND);
@ -57,5 +57,4 @@ public class Command_kick extends FreedomCommand
return true; return true;
} }
} }

View File

@ -12,7 +12,7 @@ import org.bukkit.entity.Player;
import java.util.Random; import java.util.Random;
@CommandPermissions(level = Rank.NON_OP, source = SourceType.ONLY_IN_GAME) @CommandPermissions(level = Rank.NON_OP, source = SourceType.ONLY_IN_GAME)
@CommandParameters(description = "Link your discord account to your minecraft account", usage = "/<command>") @CommandParameters(description = "Link your Discord account to your Minecraft account", usage = "/<command>")
public class Command_linkdiscord extends FreedomCommand public class Command_linkdiscord extends FreedomCommand
{ {
@ -21,7 +21,7 @@ public class Command_linkdiscord extends FreedomCommand
{ {
if (!plugin.dc.enabled) if (!plugin.dc.enabled)
{ {
msg("The discord verification system is currently disabled.", ChatColor.RED); msg("The Discord verification system is currently disabled.", ChatColor.RED);
return true; return true;
} }
@ -30,7 +30,7 @@ public class Command_linkdiscord extends FreedomCommand
Admin admin = plugin.al.getAdmin(playerSender); Admin admin = plugin.al.getAdmin(playerSender);
if (admin.getDiscordID() != null) if (admin.getDiscordID() != null)
{ {
msg("Your minecraft account is already linked to a discord account.", ChatColor.RED); msg("Your Minecraft account is already linked to a Discord account.", ChatColor.RED);
return true; return true;
} }
@ -55,7 +55,7 @@ public class Command_linkdiscord extends FreedomCommand
VPlayer data = plugin.pv.getVerificationPlayer(playerSender); VPlayer data = plugin.pv.getVerificationPlayer(playerSender);
if (data.getDiscordId() != null) if (data.getDiscordId() != null)
{ {
msg("Your minecraft account is already linked to a discord account.", ChatColor.RED); msg("Your Minecraft account is already linked to a Discord account.", ChatColor.RED);
return true; return true;
} }

View File

@ -9,7 +9,6 @@ import org.bukkit.entity.Player;
@CommandParameters(description = "Teleport to the spawn point for the current world.", usage = "/<command>", aliases = "worldspawn,gotospawn") @CommandParameters(description = "Teleport to the spawn point for the current world.", usage = "/<command>", aliases = "worldspawn,gotospawn")
public class Command_localspawn extends FreedomCommand public class Command_localspawn 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)
{ {

View File

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

View File

@ -3,7 +3,6 @@ package me.totalfreedom.totalfreedommod.command;
import me.totalfreedom.totalfreedommod.admin.Admin; import me.totalfreedom.totalfreedommod.admin.Admin;
import me.totalfreedom.totalfreedommod.rank.Rank; import me.totalfreedom.totalfreedommod.rank.Rank;
import me.totalfreedom.totalfreedommod.util.FUtil; import me.totalfreedom.totalfreedommod.util.FUtil;
import net.pravian.aero.util.ChatUtils;
import net.pravian.aero.util.Ips; import net.pravian.aero.util.Ips;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
@ -222,5 +221,4 @@ public class Command_myadmin extends FreedomCommand
} }
} }
} }
} }

View File

@ -7,10 +7,9 @@ import org.bukkit.entity.Player;
import me.totalfreedom.totalfreedommod.util.History; import me.totalfreedom.totalfreedommod.util.History;
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH) @CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
@CommandParameters(description = "Check name history of username.", usage = "/<command> <username>") @CommandParameters(description = "Check name history of username.", usage = "/<command> <username>", aliases = "nh")
public class Command_namehistory extends FreedomCommand public class Command_namehistory extends FreedomCommand
{ {
@Override @Override
public boolean run(final CommandSender sender, final Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) public boolean run(final CommandSender sender, final Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
{ {

View File

@ -2,43 +2,45 @@ package me.totalfreedom.totalfreedommod.command;
import me.totalfreedom.totalfreedommod.playerverification.VPlayer; import me.totalfreedom.totalfreedommod.playerverification.VPlayer;
import me.totalfreedom.totalfreedommod.rank.Rank; import me.totalfreedom.totalfreedommod.rank.Rank;
import me.totalfreedom.totalfreedommod.util.FUtil;
import net.pravian.aero.util.Ips; import net.pravian.aero.util.Ips;
import org.apache.commons.lang3.StringUtils;
import org.bukkit.ChatColor; 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;
@CommandPermissions(level = Rank.OP, source = SourceType.ONLY_IN_GAME) @CommandPermissions(level = Rank.OP, source = SourceType.ONLY_IN_GAME)
@CommandParameters(description = "Manage your verification", usage = "/<command> <enable | disable | clearips | status> <discord | forum>", aliases = "playerverification,pv") @CommandParameters(description = "Manage your verification", usage = "/<command> <<enable | disable | clearips | status> <discord | forum> | settag <tag> | cleartag>", aliases = "playerverification,pv")
public class Command_playerverify extends FreedomCommand public class Command_playerverify extends FreedomCommand
{ {
@Override @Override
protected boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) protected boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
{ {
VPlayer target = plugin.pv.getVerificationPlayer(playerSender);
if (args.length == 1) if (args.length == 1)
{ {
if (args[0].equalsIgnoreCase("clearips")) if (args[0].equalsIgnoreCase("clearips"))
{ {
VPlayer data = plugin.pv.getVerificationPlayer(playerSender);
int cleared = 0; int cleared = 0;
for (String ip : data.getIps()) for (String ip : target.getIps())
{ {
if (!ip.equals(Ips.getIp(playerSender))) if (!ip.equals(Ips.getIp(playerSender)))
{ {
data.removeIp(ip); target.removeIp(ip);
cleared++; cleared++;
} }
} }
msg("Cleared all IP's except your current IP \"" + Ips.getIp(playerSender) + "\""); msg("Cleared all IP's except your current IP \"" + Ips.getIp(playerSender) + "\"");
msg("Cleared " + cleared + " IP's."); msg("Cleared " + cleared + " IP's.");
plugin.pv.saveVerificationData(data); plugin.pv.saveVerificationData(target);
return true; return true;
} }
} }
if (args.length < 2) if (args.length < 1)
{ {
return false; return false;
} }
@ -48,6 +50,23 @@ public class Command_playerverify extends FreedomCommand
msg("This command is only for OP's.", ChatColor.RED); msg("This command is only for OP's.", ChatColor.RED);
return true; return true;
} }
switch (args[0])
{
case "cleartag":
{
msg("Cleared personal default tag");
target.setTag(null);
plugin.pv.saveVerificationData(target);
return true;
}
}
if (args.length < 2)
{
return false;
}
switch (args[0].toLowerCase()) switch (args[0].toLowerCase())
{ {
case "enable": case "enable":
@ -56,7 +75,7 @@ public class Command_playerverify extends FreedomCommand
case "discord": case "discord":
if (!plugin.dc.enabled) if (!plugin.dc.enabled)
{ {
msg("The discord verification system is currently disabled.", ChatColor.RED); msg("The Discord verification system is currently disabled.", ChatColor.RED);
return true; return true;
} }
VPlayer data = plugin.pv.getVerificationPlayer(playerSender); VPlayer data = plugin.pv.getVerificationPlayer(playerSender);
@ -67,14 +86,15 @@ public class Command_playerverify extends FreedomCommand
} }
data.setDiscordEnabled(true); data.setDiscordEnabled(true);
plugin.pv.saveVerificationData(data); plugin.pv.saveVerificationData(data);
msg("Enabled discord verification. Please type /linkdiscord to link a discord account.", ChatColor.GREEN); msg("Enabled Discord verification. Please type /linkdiscord to link a Discord account.", ChatColor.GREEN);
return true; return true;
case "forum": case "forum":
msg("TODO. This will be enabled in a later update. Please use discord verification instead."); msg("TODO. This will be enabled in a later update. Please use Discord verification instead.");
return true; return true;
default: default:
return false; return false;
} }
case "disable": case "disable":
switch (args[1].toLowerCase()) switch (args[1].toLowerCase())
{ {
@ -87,7 +107,7 @@ public class Command_playerverify extends FreedomCommand
} }
data.setDiscordEnabled(false); data.setDiscordEnabled(false);
plugin.pv.saveVerificationData(data); plugin.pv.saveVerificationData(data);
msg("Disabled discord verification.", ChatColor.GREEN); msg("Disabled Discord verification.", ChatColor.GREEN);
return true; return true;
case "forum": case "forum":
msg("TODO. Forum verification will be enabled in a later update."); msg("TODO. Forum verification will be enabled in a later update.");
@ -95,15 +115,15 @@ public class Command_playerverify extends FreedomCommand
default: default:
return false; return false;
} }
case "status": case "status":
switch (args[1].toLowerCase()) switch (args[1].toLowerCase())
{ {
case "discord": case "discord":
VPlayer data = plugin.pv.getVerificationPlayer(playerSender); boolean enabled = target.getDiscordEnabled();
boolean enabled = data.getDiscordEnabled(); boolean specified = target.getDiscordId() != null;
boolean specified = data.getDiscordId() != null;
msg(ChatColor.GRAY + "Discord Verification Enabled: " + (enabled ? ChatColor.GREEN + "true" : ChatColor.RED + "false")); msg(ChatColor.GRAY + "Discord Verification Enabled: " + (enabled ? ChatColor.GREEN + "true" : ChatColor.RED + "false"));
msg(ChatColor.GRAY + "Discord ID: " + (specified ? ChatColor.GREEN + data.getDiscordId() : ChatColor.RED + "not set")); msg(ChatColor.GRAY + "Discord ID: " + (specified ? ChatColor.GREEN + target.getDiscordId() : ChatColor.RED + "not set"));
return true; return true;
case "forum": case "forum":
msg("TODO. Forum verification will be enabled in a later update."); msg("TODO. Forum verification will be enabled in a later update.");
@ -111,6 +131,16 @@ public class Command_playerverify extends FreedomCommand
default: default:
return false; return false;
} }
case "settag":
{
String tag = StringUtils.join(args, " ", 1, args.length);
target.setTag(tag);
msg("Your default tag is now: " + FUtil.colorize(target.getTag()));
plugin.pv.saveVerificationData(target);
return true;
}
default: default:
return false; return false;
} }

View File

@ -14,11 +14,6 @@ public class Command_setlimit 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.web.isWorldEditEnabled())
{
msg("WorldEdit is not enabled on this server.");
return true;
}
int amount = 100000; int amount = 100000;
if (args.length > 0) if (args.length > 0)
{ {
@ -32,10 +27,23 @@ public class Command_setlimit extends FreedomCommand
return true; return true;
} }
} }
FUtil.adminAction(sender.getName(), "Setting everyone's WorldEdit block modification limit to " + amount + ".", true); boolean success = false;
for (final Player player : server.getOnlinePlayers()) for (final Player player : server.getOnlinePlayers())
{
try
{ {
plugin.web.setLimit(player, amount); plugin.web.setLimit(player, amount);
success = true;
}
catch (NoClassDefFoundError | NullPointerException ex)
{
msg("WorldEdit is not enabled on this server.");
success = false;
}
}
if (success)
{
FUtil.adminAction(sender.getName(), "Setting everyone's WorldEdit block modification limit to " + amount + ".", true);
} }
return true; return true;
} }

View File

@ -2,17 +2,16 @@ package me.totalfreedom.totalfreedommod.command;
import me.totalfreedom.totalfreedommod.rank.Rank; import me.totalfreedom.totalfreedommod.rank.Rank;
import me.totalfreedom.totalfreedommod.util.FUtil; import me.totalfreedom.totalfreedommod.util.FUtil;
import org.bukkit.Location;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.entity.Player; import org.bukkit.Location;
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;
@CommandPermissions(level = Rank.OP, source = SourceType.ONLY_IN_GAME) @CommandPermissions(level = Rank.OP, source = SourceType.ONLY_IN_GAME)
@CommandParameters(description = "Go to a random place in the current world you are in", usage = "/<command>", aliases = "tpr") @CommandParameters(description = "Go to a random place in the current world you are in", usage = "/<command>", aliases = "tpr")
public class Command_tprandom extends FreedomCommand public class Command_tprandom 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)
{ {

View File

@ -47,12 +47,9 @@ public class Command_unban extends FreedomCommand
{ {
// Redo WorldEdits // Redo WorldEdits
try try
{
if (plugin.web.isWorldEditEnabled())
{ {
plugin.web.redo(player, 15); plugin.web.redo(player, 15);
} }
}
catch (NoClassDefFoundError | NullPointerException ex) catch (NoClassDefFoundError | NullPointerException ex)
{ {
} }

View File

@ -9,7 +9,7 @@ import org.bukkit.entity.Player;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
@CommandPermissions(level = Rank.OP, source = SourceType.ONLY_IN_GAME) @CommandPermissions(level = Rank.OP, source = SourceType.ONLY_IN_GAME)
@CommandParameters(description = "Unlink your discord account to your minecraft account", usage = "/<command>") @CommandParameters(description = "Unlink your Discord account to your Minecraft account", usage = "/<command>")
public class Command_unlinkdiscord extends FreedomCommand public class Command_unlinkdiscord extends FreedomCommand
{ {
@ -18,7 +18,7 @@ public class Command_unlinkdiscord extends FreedomCommand
{ {
if (!plugin.dc.enabled) if (!plugin.dc.enabled)
{ {
msg("The discord verification system is currently disabled.", ChatColor.RED); msg("The Discord verification system is currently disabled.", ChatColor.RED);
return true; return true;
} }
@ -27,11 +27,11 @@ public class Command_unlinkdiscord extends FreedomCommand
Admin admin = plugin.al.getAdmin(playerSender); Admin admin = plugin.al.getAdmin(playerSender);
if (admin.getDiscordID() == null) if (admin.getDiscordID() == null)
{ {
msg("Your Minecraft account is not linked to a discord account.", ChatColor.RED); msg("Your Minecraft account is not linked to a Discord account.", ChatColor.RED);
return true; return true;
} }
admin.setDiscordID(null); admin.setDiscordID(null);
msg("Your Minecraft account has been successfully unlinked from the discord account.", ChatColor.GREEN); msg("Your Minecraft account has been successfully unlinked from the Discord account.", ChatColor.GREEN);
return true; return true;
} }
else else
@ -39,12 +39,12 @@ public class Command_unlinkdiscord extends FreedomCommand
VPlayer data = plugin.pv.getVerificationPlayer(playerSender); VPlayer data = plugin.pv.getVerificationPlayer(playerSender);
if (data.getDiscordId() == null) if (data.getDiscordId() == null)
{ {
msg("Your Minecraft account is not linked to a discord account.", ChatColor.RED); msg("Your Minecraft account is not linked to a Discord account.", ChatColor.RED);
return true; return true;
} }
data.setDiscordId(null); data.setDiscordId(null);
data.setDiscordEnabled(false); data.setDiscordEnabled(false);
msg("Your Minecraft account has been successfully unlinked from the discord account.", ChatColor.GREEN); msg("Your Minecraft account has been successfully unlinked from the Discord account.", ChatColor.GREEN);
return true; return true;
} }
} }

View File

@ -27,13 +27,13 @@ public class Command_verify extends FreedomCommand
if (!plugin.dc.enabled) if (!plugin.dc.enabled)
{ {
msg("The discord verification system is currently disabled", ChatColor.RED); msg("The Discord verification system is currently disabled", ChatColor.RED);
return true; return true;
} }
if (!plugin.al.isAdminImpostor(playerSender) && !plugin.pv.isPlayerImpostor(playerSender)) if (!plugin.al.isAdminImpostor(playerSender) && !plugin.pv.isPlayerImpostor(playerSender))
{ {
msg("You are not an imposter, therefore you do not need to verify.", ChatColor.RED); msg("You are not an impostor, therefore you do not need to verify.", ChatColor.RED);
return true; return true;
} }
@ -44,7 +44,7 @@ public class Command_verify extends FreedomCommand
Admin admin = plugin.al.getEntryByName(playerSender.getName()); Admin admin = plugin.al.getEntryByName(playerSender.getName());
if (admin.getDiscordID() == null) if (admin.getDiscordID() == null)
{ {
msg("You do not have a discord account linked to your minecraft account, please verify the manual way.", ChatColor.RED); msg("You do not have a Discord account linked to your Minecraft account, please verify the manual way.", ChatColor.RED);
return true; return true;
} }
discordId = admin.getDiscordID(); discordId = admin.getDiscordID();
@ -55,7 +55,7 @@ public class Command_verify extends FreedomCommand
{ {
if (plugin.pv.getVerificationPlayer(playerSender).getDiscordId() == null) if (plugin.pv.getVerificationPlayer(playerSender).getDiscordId() == null)
{ {
msg("You do not have a discord account linked to your minecraft account, please verify the manual way.", ChatColor.RED); msg("You do not have a Discord account linked to your Minecraft account, please verify the manual way.", ChatColor.RED);
return true; return true;
} }
discordId = plugin.pv.getVerificationPlayer(playerSender).getDiscordId(); discordId = plugin.pv.getVerificationPlayer(playerSender).getDiscordId();
@ -71,7 +71,7 @@ public class Command_verify extends FreedomCommand
code += random.nextInt(10); code += random.nextInt(10);
} }
Discord.VERIFY_CODES.add(code); Discord.VERIFY_CODES.add(code);
Discord.bot.getUserById(discordId).openPrivateChannel().complete().sendMessage("A user with the ip `" + Ips.getIp(playerSender) + "` has sent a verification request. Please run the following in-game command: `/verify " + code + "`").complete(); Discord.bot.getUserById(discordId).openPrivateChannel().complete().sendMessage("A user with the IP `" + Ips.getIp(playerSender) + "` has sent a verification request. Please run the following in-game command: `/verify " + code + "`").complete();
msg("A verification code has been sent to your account, please copy the code and run /verify <code>", ChatColor.GREEN); msg("A verification code has been sent to your account, please copy the code and run /verify <code>", ChatColor.GREEN);
} }
else else
@ -88,7 +88,7 @@ public class Command_verify extends FreedomCommand
{ {
Admin admin = plugin.al.getEntryByName(playerSender.getName()); Admin admin = plugin.al.getEntryByName(playerSender.getName());
Discord.VERIFY_CODES.remove(code); Discord.VERIFY_CODES.remove(code);
FUtil.bcastMsg(playerSender.getName() + " has verified themself!", ChatColor.GOLD); FUtil.bcastMsg(playerSender.getName() + " has verified!", ChatColor.GOLD);
FUtil.adminAction(ConfigEntry.SERVER_NAME.getString(), "Readding " + admin.getName() + " to the admin list", true); FUtil.adminAction(ConfigEntry.SERVER_NAME.getString(), "Readding " + admin.getName() + " to the admin list", true);
if (playerSender != null) if (playerSender != null)
{ {
@ -144,11 +144,13 @@ public class Command_verify extends FreedomCommand
else else
{ {
final FPlayer fPlayer = plugin.pl.getPlayer(playerSender); final FPlayer fPlayer = plugin.pl.getPlayer(playerSender);
FUtil.bcastMsg(playerSender.getName() + " has verified themself!", ChatColor.GOLD); FUtil.bcastMsg(playerSender.getName() + " has verified!", ChatColor.GOLD);
if (playerSender != null) if (playerSender != null)
{ {
plugin.rm.updateDisplay(playerSender); plugin.rm.updateDisplay(playerSender);
} }
playerSender.setOp(true);
msg(YOU_ARE_OP);
if (fPlayer.getFreezeData().isFrozen()) if (fPlayer.getFreezeData().isFrozen())
{ {
fPlayer.getFreezeData().setFrozen(false); fPlayer.getFreezeData().setFrozen(false);

View File

@ -12,7 +12,6 @@ import org.bukkit.entity.Player;
@CommandParameters(description = "Manage the whitelist.", usage = "/<command> <on | off | list | count | add <player> | remove <player> | addall | purge>") @CommandParameters(description = "Manage the whitelist.", usage = "/<command> <on | off | list | count | add <player> | remove <player> | addall | purge>")
public class Command_whitelist extends FreedomCommand public class Command_whitelist 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)
{ {
@ -24,6 +23,11 @@ public class Command_whitelist extends FreedomCommand
// list // list
if (args[0].equalsIgnoreCase("list")) if (args[0].equalsIgnoreCase("list"))
{ {
if (server.getWhitelistedPlayers().isEmpty())
{
msg("There are no whitelisted players.");
return true;
}
msg("Whitelisted players: " + FUtil.playerListToNames(server.getWhitelistedPlayers())); msg("Whitelisted players: " + FUtil.playerListToNames(server.getWhitelistedPlayers()));
return true; return true;
} }
@ -51,20 +55,16 @@ public class Command_whitelist extends FreedomCommand
msg("Online whitelisted players: " + onlineWPs); msg("Online whitelisted players: " + onlineWPs);
msg("Offline whitelisted players: " + offlineWPs); msg("Offline whitelisted players: " + offlineWPs);
msg("Total whitelisted players: " + totalWPs); msg("Total whitelisted players: " + totalWPs);
return true; return true;
} }
// all commands past this line are superadmin-only // Commands below are restricted to admins
if (!(senderIsConsole || plugin.al.isAdmin(sender))) checkRank(Rank.SUPER_ADMIN);
{
return noPerms();
}
// on // on
if (args[0].equalsIgnoreCase("on")) if (args[0].equalsIgnoreCase("on"))
{ {
FUtil.adminAction(sender.getName(), "Turning the whitelist on.", true); FUtil.adminAction(sender.getName(), "Turning the whitelist on", true);
server.setWhitelist(true); server.setWhitelist(true);
return true; return true;
} }
@ -72,7 +72,7 @@ public class Command_whitelist extends FreedomCommand
// off // off
if (args[0].equalsIgnoreCase("off")) if (args[0].equalsIgnoreCase("off"))
{ {
FUtil.adminAction(sender.getName(), "Turning the whitelist off.", true); FUtil.adminAction(sender.getName(), "Turning the whitelist off", true);
server.setWhitelist(false); server.setWhitelist(false);
return true; return true;
} }
@ -94,7 +94,7 @@ public class Command_whitelist extends FreedomCommand
player = DepreciationAggregator.getOfflinePlayer(server, search_name); player = DepreciationAggregator.getOfflinePlayer(server, search_name);
} }
FUtil.adminAction(sender.getName(), "Adding " + player.getName() + " to the whitelist.", false); FUtil.adminAction(sender.getName(), "Adding " + player.getName() + " to the whitelist", false);
player.setWhitelisted(true); player.setWhitelisted(true);
return true; return true;
} }
@ -118,7 +118,7 @@ public class Command_whitelist extends FreedomCommand
if (player.isWhitelisted()) if (player.isWhitelisted())
{ {
FUtil.adminAction(sender.getName(), "Removing " + player.getName() + " from the whitelist.", false); FUtil.adminAction(sender.getName(), "Removing " + player.getName() + " from the whitelist", false);
player.setWhitelisted(false); player.setWhitelisted(false);
return true; return true;
} }
@ -127,13 +127,12 @@ public class Command_whitelist extends FreedomCommand
msg("That player is not whitelisted"); msg("That player is not whitelisted");
return true; return true;
} }
} }
// addall // addall
if (args[0].equalsIgnoreCase("addall")) if (args[0].equalsIgnoreCase("addall"))
{ {
FUtil.adminAction(sender.getName(), "Adding all online players to the whitelist.", false); FUtil.adminAction(sender.getName(), "Adding all online players to the whitelist", false);
int counter = 0; int counter = 0;
for (Player player : server.getOnlinePlayers()) for (Player player : server.getOnlinePlayers())
{ {
@ -148,25 +147,17 @@ public class Command_whitelist extends FreedomCommand
return true; return true;
} }
// all commands past this line are console/telnet only // Telnet only
if (!senderIsConsole) checkConsole();
{ checkRank(Rank.TELNET_ADMIN);
noPerms();
return true;
}
//purge // purge
if (args[0].equalsIgnoreCase("purge")) if (args[0].equalsIgnoreCase("purge"))
{ {
// FUtil.adminAction(sender.getName(), "Removing all players from the whitelist.", false); FUtil.adminAction(sender.getName(), "Removing all players from the whitelist", false);
// msg("Removed " + plugin.si.purgeWhitelist() + " players from the whitelist."); msg("Removed " + plugin.si.purgeWhitelist() + " players from the whitelist.");
FUtil.adminAction(sender.getName(), "Whitelist purging is temporarily disabled.", true);
return true; return true;
} }
// none of the commands were executed
return false; return false;
} }
} }

View File

@ -26,7 +26,7 @@ public class Command_wipeflatlands extends FreedomCommand
FUtil.bcastMsg("Server is going offline for flatlands wipe.", ChatColor.GRAY); FUtil.bcastMsg("Server is going offline for flatlands wipe.", ChatColor.GRAY);
if (plugin.wgb.isPluginEnabled()) if (plugin.wgb.isEnabled())
{ {
plugin.wgb.wipeRegions(plugin.wm.flatlands.getWorld()); plugin.wgb.wipeRegions(plugin.wm.flatlands.getWorld());
} }

View File

@ -15,7 +15,7 @@ public class Command_wiperegions 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.wgb.isPluginEnabled()) if (!plugin.wgb.isEnabled())
{ {
msg("WorldGuard is not enabled."); msg("WorldGuard is not enabled.");
return true; return true;

View File

@ -20,7 +20,7 @@ public class Command_wipeuserdata extends FreedomCommand
{ {
if (!server.getPluginManager().isPluginEnabled("Essentials")) if (!server.getPluginManager().isPluginEnabled("Essentials"))
{ {
msg("Essentials is not enabled on this server"); msg("Essentials is not enabled on this server.");
return true; return true;
} }

View File

@ -17,7 +17,7 @@ public class Command_wipewarps 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.esb.isEssentialsEnabled()) if (!plugin.esb.isEnabled())
{ {
msg("Essentials is not enabled on this server."); msg("Essentials is not enabled on this server.");
return true; return true;

View File

@ -7,8 +7,6 @@ import java.util.List;
public enum ConfigEntry public enum ConfigEntry
{ {
FORCE_IP_ENABLED(Boolean.class, "forceip.enabled"), FORCE_IP_ENABLED(Boolean.class, "forceip.enabled"),
FORCE_IP_PORT(Integer.class, "forceip.port"), FORCE_IP_PORT(Integer.class, "forceip.port"),
FORCE_IP_KICKMSG(String.class, "forceip.kickmsg"), FORCE_IP_KICKMSG(String.class, "forceip.kickmsg"),

View File

@ -12,7 +12,6 @@ public class MessageListener extends ListenerAdapter
{ {
if (!event.getAuthor().getId().equals(Discord.bot.getSelfUser().getId())) if (!event.getAuthor().getId().equals(Discord.bot.getSelfUser().getId()))
{ {
// Handle link code // Handle link code
if (event.getMessage().getContentRaw().matches("[0-9][0-9][0-9][0-9][0-9]")) if (event.getMessage().getContentRaw().matches("[0-9][0-9][0-9][0-9][0-9]"))
{ {

View File

@ -56,12 +56,7 @@ public class Module_help extends HTTPDModule
pluginName = ((PluginIdentifiableCommand) command).getPlugin().getName(); pluginName = ((PluginIdentifiableCommand) command).getPlugin().getName();
} }
List<Command> pluginCommands = commandsByPlugin.get(pluginName); List<Command> pluginCommands = commandsByPlugin.computeIfAbsent(pluginName, k -> Lists.newArrayList());
if (pluginCommands == null)
{
pluginCommands = Lists.newArrayList();
commandsByPlugin.put(pluginName, pluginCommands);
}
pluginCommands.add(command); pluginCommands.add(command);
} }

View File

@ -48,7 +48,7 @@ public class Module_logfile extends HTTPDModule
public String title() public String title()
{ {
return "TotalFreedomMod :: Logfiles"; return "TotalFreedomMod :: Log Files";
} }
public String body() throws ResponseOverrideException public String body() throws ResponseOverrideException

View File

@ -1,11 +1,12 @@
package me.totalfreedom.totalfreedommod.httpd.module; package me.totalfreedom.totalfreedommod.httpd.module;
import java.io.File;
import me.totalfreedom.totalfreedommod.TotalFreedomMod; import me.totalfreedom.totalfreedommod.TotalFreedomMod;
import me.totalfreedom.totalfreedommod.admin.Admin; import me.totalfreedom.totalfreedommod.admin.Admin;
import me.totalfreedom.totalfreedommod.punishments.PunishmentList;
import me.totalfreedom.totalfreedommod.httpd.HTTPDaemon; import me.totalfreedom.totalfreedommod.httpd.HTTPDaemon;
import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD; import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD;
import me.totalfreedom.totalfreedommod.punishments.PunishmentList;
import java.io.File;
public class Module_punishments extends HTTPDModule public class Module_punishments extends HTTPDModule
{ {

View File

@ -56,11 +56,6 @@ public class PlayerData implements ConfigLoadable, ConfigSavable, Validatable
cs.set("last_join", lastJoinUnix); cs.set("last_join", lastJoinUnix);
} }
public String getUsername()
{
return username;
}
public List<String> getIps() public List<String> getIps()
{ {
return Collections.unmodifiableList(ips); return Collections.unmodifiableList(ips);

View File

@ -32,6 +32,9 @@ public class VPlayer implements ConfigLoadable, ConfigSavable, Validatable
@Getter @Getter
@Setter @Setter
private Boolean forumEnabled = false; private Boolean forumEnabled = false;
@Getter
@Setter
private String tag = null;
public VPlayer(String name) public VPlayer(String name)
{ {
@ -53,6 +56,7 @@ public class VPlayer implements ConfigLoadable, ConfigSavable, Validatable
forumUsername = cs.getString("forumUsername", null); forumUsername = cs.getString("forumUsername", null);
discordEnabled = cs.getBoolean("discordEnabled", false); discordEnabled = cs.getBoolean("discordEnabled", false);
forumEnabled = cs.getBoolean("forumEnabled", false); forumEnabled = cs.getBoolean("forumEnabled", false);
tag = cs.getString("tag", null);
} }
@Override @Override
@ -64,6 +68,7 @@ public class VPlayer implements ConfigLoadable, ConfigSavable, Validatable
cs.set("forumUsername", forumUsername); cs.set("forumUsername", forumUsername);
cs.set("discordEnabled", discordEnabled); cs.set("discordEnabled", discordEnabled);
cs.set("forumEnabled", forumEnabled); cs.set("forumEnabled", forumEnabled);
cs.set("tag", tag);
cs.set("ips", Lists.newArrayList(ips)); cs.set("ips", Lists.newArrayList(ips));
} }
@ -85,7 +90,6 @@ public class VPlayer implements ConfigLoadable, ConfigSavable, Validatable
@Override @Override
public boolean isValid() public boolean isValid()
{ {
return name != null return name != null && !ips.isEmpty();
&& !ips.isEmpty();
} }
} }

View File

@ -5,6 +5,7 @@ import me.totalfreedom.totalfreedommod.TotalFreedomMod;
import me.totalfreedom.totalfreedommod.admin.Admin; import me.totalfreedom.totalfreedommod.admin.Admin;
import me.totalfreedom.totalfreedommod.config.ConfigEntry; import me.totalfreedom.totalfreedommod.config.ConfigEntry;
import me.totalfreedom.totalfreedommod.player.FPlayer; import me.totalfreedom.totalfreedommod.player.FPlayer;
import me.totalfreedom.totalfreedommod.playerverification.VPlayer;
import me.totalfreedom.totalfreedommod.util.FUtil; import me.totalfreedom.totalfreedommod.util.FUtil;
import net.pravian.aero.util.ChatUtils; import net.pravian.aero.util.ChatUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -150,6 +151,7 @@ public class RankManager extends FreedomService
final Player player = event.getPlayer(); final Player player = event.getPlayer();
//plugin.pl.getData(player); //plugin.pl.getData(player);
final FPlayer fPlayer = plugin.pl.getPlayer(player); final FPlayer fPlayer = plugin.pl.getPlayer(player);
VPlayer target = plugin.pv.getVerificationPlayer(player);
// Unban admins // Unban admins
boolean isAdmin = plugin.al.isAdmin(player); boolean isAdmin = plugin.al.isAdmin(player);
@ -169,8 +171,8 @@ public class RankManager extends FreedomService
} }
// Handle impostors // Handle impostors
Boolean isImposter = plugin.al.isAdminImpostor(player) || plugin.pv.isPlayerImpostor(player) || plugin.mbl.isMasterBuilderImpostor(player); boolean isImpostor = plugin.al.isAdminImpostor(player) || plugin.pv.isPlayerImpostor(player) || plugin.mbl.isMasterBuilderImpostor(player);
if (isImposter) if (isImpostor)
{ {
FUtil.bcastMsg(ChatColor.AQUA + player.getName() + " is " + Rank.IMPOSTOR.getColoredLoginMessage()); FUtil.bcastMsg(ChatColor.AQUA + player.getName() + " is " + Rank.IMPOSTOR.getColoredLoginMessage());
if (plugin.al.isAdminImpostor(player)) if (plugin.al.isAdminImpostor(player))
@ -230,5 +232,13 @@ public class RankManager extends FreedomService
{ {
} }
} }
if (!plugin.pv.isPlayerImpostor(player) && target.getDiscordEnabled())
{
if (target.getTag() != null)
{
plugin.pl.getPlayer(player).setTag(FUtil.colorize(target.getTag()));
}
}
} }
} }

View File

@ -1,19 +1,17 @@
package me.totalfreedom.totalfreedommod.util; package me.totalfreedom.totalfreedommod.util;
import java.util.HashSet;
import java.util.UUID;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.OfflinePlayer; import org.bukkit.OfflinePlayer;
import org.bukkit.Server; import org.bukkit.Server;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.entity.EntityType; import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
import org.bukkit.material.MaterialData;
import java.util.HashSet;
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public class DepreciationAggregator public class DepreciationAggregator
{ {
public static Block getTargetBlock(LivingEntity entity, HashSet<Material> transparent, int maxDistance) public static Block getTargetBlock(LivingEntity entity, HashSet<Material> transparent, int maxDistance)
{ {
return entity.getTargetBlock(transparent, maxDistance); return entity.getTargetBlock(transparent, maxDistance);