1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-09-17 18:02:05 +02:00

Add config option for disabling of cheats. Off by default

This commit is contained in:
md_5
2012-04-05 20:24:56 +10:00
parent 0bded50f5f
commit 530c2c4c11
4 changed files with 27 additions and 36 deletions

View File

@@ -1,9 +0,0 @@
Copyright (c) 2012 Wilfried Pasquazzo (Evenprime)
<wilfried.pasquazzo@gmail.com>
# Dual-Licensed - you may freely choose between (or use both):
#
# 1) GPL v3 (see LICENSE_GPL3.txt)
# 2) MIT (see LICENSE_MIT.txt)
#
#

View File

@@ -8,6 +8,7 @@ import com.earth2me.essentials.anticheat.checks.fight.FightCheckListener;
import com.earth2me.essentials.anticheat.checks.inventory.InventoryCheckListener;
import com.earth2me.essentials.anticheat.checks.moving.MovingCheckListener;
import com.earth2me.essentials.anticheat.command.CommandHandler;
import com.earth2me.essentials.anticheat.config.ConfPaths;
import com.earth2me.essentials.anticheat.config.ConfigurationCacheStore;
import com.earth2me.essentials.anticheat.config.ConfigurationManager;
import com.earth2me.essentials.anticheat.config.Permissions;
@@ -30,12 +31,6 @@ import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.java.JavaPlugin;
/**
*
* NoCheat
*
* Check various player events for their plausibility and log/deny them/react to them based on configuration
*/
public class NoCheat extends JavaPlugin implements Listener
{
private ConfigurationManager conf;
@@ -201,29 +196,32 @@ public class NoCheat extends JavaPlugin implements Listener
@EventHandler
public void onPlayerJoin(PlayerJoinEvent event)
{
Player p = event.getPlayer();
String message = "";
if (!p.hasPermission(Permissions.ZOMBES_FLY))
if (getConfig().getBoolean(ConfPaths.DISABLE_MODS))
{
message += "§f §f §1 §0 §2 §4"; // Zombes fly
Player p = event.getPlayer();
String message = "";
if (!p.hasPermission(Permissions.ZOMBES_FLY))
{
message += "§f §f §1 §0 §2 §4"; // Zombes fly
}
if (!p.hasPermission(Permissions.ZOMBES_CHEAT))
{
message += "§f §f §2 §0 §4 §8"; // Zombes cheat
}
if (!p.hasPermission(Permissions.CJB_FLY))
{
message += "§3 §9 §2 §0 §0 §1"; // CJB fly
}
if (!p.hasPermission(Permissions.CJB_XRAY))
{
message += "§3 §9 §2 §0 §0 §2"; // CJB xray
}
if (!p.hasPermission(Permissions.CJB_MINIMAP))
{
message += "§3 §9 §2 §0 §0 §3"; // CJB minimap players
}
p.sendMessage(message);
}
if (!p.hasPermission(Permissions.ZOMBES_CHEAT))
{
message += "§f §f §2 §0 §4 §8"; // Zombes cheat
}
if (!p.hasPermission(Permissions.CJB_FLY))
{
message += "§3 §9 §2 §0 §0 §1"; // CJB fly
}
if (!p.hasPermission(Permissions.CJB_XRAY))
{
message += "§3 §9 §2 §0 §0 §2"; // CJB xray
}
if (!p.hasPermission(Permissions.CJB_MINIMAP))
{
message += "§3 §9 §2 §0 §0 §3"; // CJB minimap players
}
p.sendMessage(message);
}
public void setFileLogger(Logger logger)

View File

@@ -16,6 +16,7 @@ public abstract class ConfPaths
public final static String LOGGING_LOGTOINGAMECHAT = LOGGING + "ingamechat";
public final static String LOGGING_SHOWACTIVECHECKS = LOGGING + "showactivechecks";
public final static String LOGGING_DEBUGMESSAGES = LOGGING + "debugmessages";
public final static String DISABLE_MODS = "disableMods";
private final static String CHECKS = "checks.";

View File

@@ -8,6 +8,7 @@ logging:
file: true
console: true
ingamechat: true
disableMods: false
checks:
inventory:
drop: