Preventing copying
Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Ursprung
04b5fa34f8
Commit
219d7acbe2
@ -5,10 +5,14 @@ import de.steamwar.fightsystem.states.FightState;
|
||||
import de.steamwar.sql.Schematic;
|
||||
import de.steamwar.sql.SteamwarUser;
|
||||
import de.steamwar.sql.UserGroup;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.logging.Level;
|
||||
|
||||
public class CheckListener extends BasicListener {
|
||||
|
||||
@ -16,6 +20,7 @@ public class CheckListener extends BasicListener {
|
||||
super(Config.check() ? EnumSet.allOf(FightState.class) : EnumSet.noneOf(FightState.class));
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onJoin(PlayerJoinEvent e){
|
||||
Player player = e.getPlayer();
|
||||
SteamwarUser user = SteamwarUser.get(player.getUniqueId());
|
||||
@ -31,6 +36,17 @@ public class CheckListener extends BasicListener {
|
||||
player.kickPlayer("");
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void handlePlayerCommandPreprocess(PlayerCommandPreprocessEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
if(!event.getMessage().contains("copy") && !event.getMessage().contains("cut"))
|
||||
return;
|
||||
|
||||
event.setCancelled(true);
|
||||
player.sendMessage("§cDieser Befehl ist beim Prüfen gesperrt! Admin wird benachrichtigt.");
|
||||
Bukkit.getLogger().log(Level.SEVERE, player.getName() + " tried to use a copy command!");
|
||||
}
|
||||
|
||||
private static boolean allowedToCheck(SteamwarUser user) {
|
||||
return user.getUserGroup() == UserGroup.Supporter ||
|
||||
user.getUserGroup() == UserGroup.Developer ||
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren