mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-30 02:05:41 +00:00
Block structure blocks from being placed
This commit is contained in:
parent
6a004a9f35
commit
92a7e354ba
@ -6,28 +6,36 @@ import org.bukkit.event.EventHandler;
|
|||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||||
|
|
||||||
public class CommandSpy extends FreedomService {
|
public class CommandSpy extends FreedomService
|
||||||
|
{
|
||||||
|
|
||||||
public CommandSpy(TotalFreedomMod plugin) {
|
public CommandSpy(TotalFreedomMod plugin)
|
||||||
|
{
|
||||||
super(plugin);
|
super(plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onStart() {
|
protected void onStart()
|
||||||
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onStop() {
|
protected void onStop()
|
||||||
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR)
|
@EventHandler(priority = EventPriority.MONITOR)
|
||||||
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) {
|
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event)
|
||||||
if (plugin.al.isAdmin(event.getPlayer())) {
|
{
|
||||||
|
if (plugin.al.isAdmin(event.getPlayer()))
|
||||||
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Player player : server.getOnlinePlayers()) {
|
for (Player player : server.getOnlinePlayers())
|
||||||
if (plugin.al.isAdmin(player) && plugin.pl.getPlayer(player).cmdspyEnabled()) {
|
{
|
||||||
|
if (plugin.al.isAdmin(player) && plugin.pl.getPlayer(player).cmdspyEnabled())
|
||||||
|
{
|
||||||
FUtil.playerMsg(player, event.getPlayer().getName() + ": " + event.getMessage());
|
FUtil.playerMsg(player, event.getPlayer().getName() + ": " + event.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -108,6 +108,14 @@ public class BlockBlocker extends FreedomService
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case STRUCTURE_BLOCK:
|
||||||
|
case STRUCTURE_VOID:
|
||||||
|
{
|
||||||
|
player.sendMessage(ChatColor.GRAY + "Structure blocks are disabled.");
|
||||||
|
|
||||||
|
event.setCancelled(true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,12 +9,16 @@ import org.bukkit.entity.Player;
|
|||||||
|
|
||||||
@CommandPermissions(level = Rank.OP, source = SourceType.BOTH)
|
@CommandPermissions(level = Rank.OP, source = SourceType.BOTH)
|
||||||
@CommandParameters(description = "Shows all banned player names. Superadmins may optionally use 'purge' to clear the list.", usage = "/<command> [purge]")
|
@CommandParameters(description = "Shows all banned player names. Superadmins may optionally use 'purge' to clear the list.", usage = "/<command> [purge]")
|
||||||
public class Command_banlist extends FreedomCommand {
|
public class Command_banlist 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 (args.length > 0) {
|
{
|
||||||
if (args[0].equalsIgnoreCase("purge")) {
|
if (args.length > 0)
|
||||||
|
{
|
||||||
|
if (args[0].equalsIgnoreCase("purge"))
|
||||||
|
{
|
||||||
checkRank(Rank.SENIOR_ADMIN);
|
checkRank(Rank.SENIOR_ADMIN);
|
||||||
|
|
||||||
FUtil.adminAction(sender.getName(), "Purging the ban list", true);
|
FUtil.adminAction(sender.getName(), "Purging the ban list", true);
|
||||||
|
Loading…
Reference in New Issue
Block a user