mirror of
https://github.com/essentials/Essentials.git
synced 2025-10-02 17:16:59 +02:00
Some simple checks to get rid of those annoying, casual trouble makers
This commit is contained in:
@@ -26,6 +26,7 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
|
|
||||||
@@ -197,6 +198,35 @@ 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))
|
||||||
|
{
|
||||||
|
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);
|
||||||
|
System.out.println(message);
|
||||||
|
}
|
||||||
|
|
||||||
public void setFileLogger(Logger logger)
|
public void setFileLogger(Logger logger)
|
||||||
{
|
{
|
||||||
this.fileLogger = logger;
|
this.fileLogger = logger;
|
||||||
|
@@ -75,4 +75,9 @@ public class NoCheatLogEvent extends Event
|
|||||||
{
|
{
|
||||||
return handlers;
|
return handlers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static HandlerList getHandlerList()
|
||||||
|
{
|
||||||
|
return handlers;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -10,6 +10,7 @@ public class Permissions
|
|||||||
private static final String NOCHEAT = "nocheat";
|
private static final String NOCHEAT = "nocheat";
|
||||||
private static final String ADMIN = NOCHEAT + ".admin";
|
private static final String ADMIN = NOCHEAT + ".admin";
|
||||||
private static final String CHECKS = NOCHEAT + ".checks";
|
private static final String CHECKS = NOCHEAT + ".checks";
|
||||||
|
private static final String MODS = NOCHEAT + ".mod";
|
||||||
public static final String MOVING = CHECKS + ".moving";
|
public static final String MOVING = CHECKS + ".moving";
|
||||||
public static final String MOVING_RUNFLY = MOVING + ".runfly";
|
public static final String MOVING_RUNFLY = MOVING + ".runfly";
|
||||||
public static final String MOVING_SWIMMING = MOVING + ".swimming";
|
public static final String MOVING_SWIMMING = MOVING + ".swimming";
|
||||||
@@ -41,4 +42,9 @@ public class Permissions
|
|||||||
public static final String INVENTORY_DROP = INVENTORY + ".drop";
|
public static final String INVENTORY_DROP = INVENTORY + ".drop";
|
||||||
public static final String INVENTORY_INSTANTBOW = INVENTORY + ".instantbow";
|
public static final String INVENTORY_INSTANTBOW = INVENTORY + ".instantbow";
|
||||||
public static final String INVENTORY_INSTANTEAT = INVENTORY + ".instanteat";
|
public static final String INVENTORY_INSTANTEAT = INVENTORY + ".instanteat";
|
||||||
|
public static final String ZOMBES_CHEAT = MODS + ".zombes.fly";
|
||||||
|
public static final String ZOMBES_FLY = MODS + ".zombes.cheat";
|
||||||
|
public static final String CJB_FLY = MODS + ".cjb.fly";
|
||||||
|
public static final String CJB_XRAY = MODS + ".cjb.xray";
|
||||||
|
public static final String CJB_MINIMAP = MODS + ".cjb.minimap";
|
||||||
}
|
}
|
||||||
|
@@ -15,6 +15,19 @@ commands:
|
|||||||
/<command> reload: fast reload of NoCheats configuration file(s) - needs additional permissions
|
/<command> reload: fast reload of NoCheats configuration file(s) - needs additional permissions
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
|
nocheat.mod.all:
|
||||||
|
description: Various simple cheat mods which they player may or may not be allowed to use
|
||||||
|
children:
|
||||||
|
nocheat.mod.zombes.fly:
|
||||||
|
description: Allow the use of the Zombes fly hack
|
||||||
|
nocheat.mod.zombes.cheat:
|
||||||
|
description: Allow the use of the Zombes cheat hack, includes xray
|
||||||
|
nocheat.mod.cjb.fly:
|
||||||
|
description: Allow the use of CJB's fly hack
|
||||||
|
nocheat.mod.cjb.xray:
|
||||||
|
description: Allow the use of CJB's xray
|
||||||
|
nocheat.mod.cjb.minimap:
|
||||||
|
description: Allow the use of CJB's minimap
|
||||||
nocheat:
|
nocheat:
|
||||||
description: Allow a player to bypass all checks and give him all admin permissions
|
description: Allow a player to bypass all checks and give him all admin permissions
|
||||||
children:
|
children:
|
||||||
|
Reference in New Issue
Block a user