Added prelog

Fixed annoying commands
More config junk
This commit is contained in:
Steven Lawson 2011-09-26 18:28:01 -04:00
parent bb2e32519b
commit 3ba39d40c2
3 changed files with 601 additions and 484 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,13 +1,41 @@
package me.StevenLawson.TotalFreedomMod; package me.StevenLawson.TotalFreedomMod;
import java.util.logging.Logger;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.player.PlayerListener; import org.bukkit.event.player.PlayerListener;
class TotalFreedomModPlayerListener extends PlayerListener class TotalFreedomModPlayerListener extends PlayerListener
{ {
public static TotalFreedomMod plugin; public static TotalFreedomMod plugin;
private static final Logger log = Logger.getLogger("Minecraft");
TotalFreedomModPlayerListener(TotalFreedomMod instance) TotalFreedomModPlayerListener(TotalFreedomMod instance)
{ {
plugin = instance; plugin = instance;
} }
@Override
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event)
{
String command = event.getMessage();
Player player = event.getPlayer();
if (plugin.preprocessLogEnabled)
{
log.info(String.format("[PREPROCESS_COMMAND] %s(%s): %s", player.getName(), ChatColor.stripColor(player.getDisplayName()), command));
}
if (command.startsWith("/stop") && !command.equals("/stop"))
{
event.setCancelled(true);
player.sendMessage(ChatColor.RED + "Piss off.");
}
else if (command.startsWith("/zeus") || command.startsWith("/vulcan"))
{
event.setCancelled(true);
player.sendMessage(ChatColor.RED + "Piss off.");
}
}
} }

View File

@ -1,6 +1,6 @@
name: TotalFreedomMod name: TotalFreedomMod
main: me.StevenLawson.TotalFreedomMod.TotalFreedomMod main: me.StevenLawson.TotalFreedomMod.TotalFreedomMod
version: 1.3 version: 1.4
description: Plugin for the Total Freedom server description: Plugin for the Total Freedom server
author: StevenLawson / Madgeek1450 author: StevenLawson / Madgeek1450
commands: commands:
@ -37,6 +37,9 @@ commands:
opme: opme:
description: Superadmin command - Automatically ops user. description: Superadmin command - Automatically ops user.
usage: /<command> usage: /<command>
prelog:
description: Superadmin command - Enable/disable the command prelogger. When this is on, logs will be filled with many duplicate messages.
usage: /<command> <on|off>
qdeop: qdeop:
description: Quick De-Op - deop someone based on a partial name. description: Quick De-Op - deop someone based on a partial name.
usage: /<command> <partialname> usage: /<command> <partialname>