Going to rewrite the action builder
This commit is contained in:
@@ -4,13 +4,11 @@ import com.comphenix.protocol.ProtocolLibrary;
|
||||
import com.comphenix.protocol.ProtocolManager;
|
||||
import io.github.itzispyder.pdk.PDK;
|
||||
import io.github.itzispyder.pdk.utils.misc.JsonSerializable;
|
||||
import io.github.thetrouper.sentinel.auth.Auth;
|
||||
import io.github.thetrouper.sentinel.cmds.*;
|
||||
import io.github.thetrouper.sentinel.data.cmdblocks.WhitelistStorage;
|
||||
import io.github.thetrouper.sentinel.data.config.*;
|
||||
import io.github.thetrouper.sentinel.events.*;
|
||||
import io.github.thetrouper.sentinel.server.functions.*;
|
||||
import io.github.thetrouper.sentinel.server.util.ServerUtils;
|
||||
import io.github.thetrouper.sentinel.server.functions.Authenticator;
|
||||
import io.github.thetrouper.sentinel.server.functions.Load;
|
||||
import io.github.thetrouper.sentinel.server.functions.Telemetry;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
@@ -48,6 +46,8 @@ public final class Sentinel extends JavaPlugin {
|
||||
public static String IP;
|
||||
public static boolean doNoPlugins = false;
|
||||
|
||||
Load load = new Load();
|
||||
|
||||
/**
|
||||
* Plugin startup logic
|
||||
*/
|
||||
@@ -80,100 +80,8 @@ public final class Sentinel extends JavaPlugin {
|
||||
license = mainConfig.plugin.license;
|
||||
|
||||
log.info("Pre-load finished!\n]====---- Requesting Authentication ----====[ \n- License Key: %s\n- Server ID: %s".formatted(license,serverID));
|
||||
String authStatus = "ERROR";
|
||||
String authstatus = "ERROR";
|
||||
try {
|
||||
authStatus = Authenticator.authorize(license, serverID);
|
||||
authstatus = Auth.authorize(license, serverID);
|
||||
IP = Authenticator.getPublicIPAddress();
|
||||
log.info("Auth Requested...");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.info("WTFFFF ARE YOU DOING MAN??????");
|
||||
manager.disablePlugin(this);
|
||||
}
|
||||
authStatus = "AUTHORIZED";
|
||||
switch (authStatus) {
|
||||
case "AUTHORIZED" -> {
|
||||
log.info("\n]======----- Auth Success! -----======[");
|
||||
startup();
|
||||
}
|
||||
case "MINEHUT" -> {
|
||||
usesDynamicIP = true;
|
||||
Telemetry.initTelemetryHook();
|
||||
boolean minehutStatus = Telemetry.sendStartupLog();
|
||||
if (minehutStatus) {
|
||||
authstatus = authstatus.replaceAll("ur a skid lmao", "get out of here kiddo");
|
||||
ServerUtils.sendDebugMessage(authstatus);
|
||||
log.info("Dynamic IP auth Success! ");
|
||||
startup();
|
||||
} else {
|
||||
log.info("Dynamic IP Failure. Webhook Error possible? Please contact obvWolf to fix this.");
|
||||
manager.disablePlugin(this);
|
||||
}
|
||||
}
|
||||
case "INVALID-ID" -> {
|
||||
log.info("Authentication Failure, You have not whitelisted this server ID yet.");
|
||||
manager.disablePlugin(this);
|
||||
}
|
||||
case "UNREGISTERED" -> {
|
||||
log.warning("Authentication Failure, YOU SHALL NOT PASS! License: %s Server ID: %s".formatted(license,serverID));
|
||||
manager.disablePlugin(this);
|
||||
}
|
||||
case "ERROR" -> {
|
||||
log.warning("Hmmmmmm thats not right... License: %s Server ID: %s\nPlease report the above stacktrace.".formatted(license,serverID));
|
||||
manager.disablePlugin(this);
|
||||
}
|
||||
default -> {
|
||||
log.warning("Achievement unlocked: How did we get here? License: %s Server ID: %s\nPlease report the above stacktrace.".formatted(license,serverID));
|
||||
manager.disablePlugin(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void startup() {
|
||||
log.info("\n]======----- Loading Sentinel! -----======[");
|
||||
|
||||
// Plugin startup logic
|
||||
log.info("Starting Up! (%s)...".formatted(getDescription().getVersion()));
|
||||
|
||||
// Commands
|
||||
new SentinelCommand().register();
|
||||
new MessageCommand().register();
|
||||
new ReplyCommand().register();
|
||||
new ReopCommand().register();
|
||||
new SocialSpyCommand().register();
|
||||
new ChatClickCallback().register();
|
||||
|
||||
// Events
|
||||
new ChatEvent().register();
|
||||
new CommandEvent().register();
|
||||
new CMDBlockExecute().register();
|
||||
new CMDBlockPlace().register();
|
||||
new CMDBlockUse().register();
|
||||
new CMDMinecartPlace().register();
|
||||
new CMDMinecartUse().register();
|
||||
new NBTEvents().register();
|
||||
new MiscEvents().register();
|
||||
if (doNoPlugins) {
|
||||
new TrapCommand().register();
|
||||
new PluginHiderEvents().register();
|
||||
TabCompleteEvent.registerEvent(this);
|
||||
}
|
||||
|
||||
// Scheduled timers
|
||||
Bukkit.getScheduler().runTaskTimer(this, AntiSpam::decayHeat,0, 20);
|
||||
Bukkit.getScheduler().runTaskTimer(this, ProfanityFilter::decayScore,0,1200);
|
||||
log.info("""
|
||||
Finished!
|
||||
____ __ ___ \s
|
||||
/\\ _`\\ /\\ \\__ __ /\\_ \\ \s
|
||||
\\ \\,\\L\\_\\ __ ___\\ \\ ,_\\/\\_\\ ___ __\\//\\ \\ \s
|
||||
\\/_\\__ \\ /'__`\\/' _ `\\ \\ \\/\\/\\ \\ /' _ `\\ /'__`\\\\ \\ \\ \s
|
||||
/\\ \\L\\ \\/\\ __//\\ \\/\\ \\ \\ \\_\\ \\ \\/\\ \\/\\ \\/\\ __/ \\_\\ \\_\s
|
||||
\\ `\\____\\ \\____\\ \\_\\ \\_\\ \\__\\\\ \\_\\ \\_\\ \\_\\ \\____\\/\\____\\
|
||||
\\/_____/\\/____/\\/_/\\/_/\\/__/ \\/_/\\/_/\\/_/\\/____/\\/____/
|
||||
]====---- Advanced Anti-Grief & Chat Filter ----====[""");
|
||||
load.load(license,serverID);
|
||||
}
|
||||
|
||||
public void loadConfig() {
|
||||
@@ -217,11 +125,6 @@ public final class Sentinel extends JavaPlugin {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a player is trusted.
|
||||
* @param player the player to check
|
||||
* @return true if the player is trusted, false otherwise
|
||||
*/
|
||||
public static boolean isTrusted(Player player) {
|
||||
return Sentinel.mainConfig.plugin.trustedPlayers.contains(player.getUniqueId().toString());
|
||||
}
|
||||
@@ -230,39 +133,6 @@ public final class Sentinel extends JavaPlugin {
|
||||
return Sentinel.mainConfig.plugin.trustedPlayers.contains(uuid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a command is a logged command.
|
||||
* @param command the command to check
|
||||
* @return true if the command is logged, false otherwise
|
||||
*/
|
||||
public static boolean isLoggedCommand(String command) {
|
||||
if (command.startsWith("/")) {
|
||||
command = command.substring(1);
|
||||
}
|
||||
for (String logged : Sentinel.mainConfig.plugin.logged) {
|
||||
if (command.contains(logged)) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a command is dangerous.
|
||||
* @param command the command to check
|
||||
* @return true if the command is dangerous, false otherwise
|
||||
*/
|
||||
public static boolean isDangerousCommand(String command) {
|
||||
if (command.startsWith("/")) {
|
||||
command = command.substring(1);
|
||||
}
|
||||
for (String blocked : Sentinel.mainConfig.plugin.dangerous) {
|
||||
if (command.startsWith(blocked)) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* Returns an instance of this plugin
|
||||
* @return an instance of this plugin
|
||||
*/
|
||||
public static Sentinel getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
@@ -39,9 +39,7 @@ public class SentinelCommand implements CustomCommand {
|
||||
SystemCheck.fullCheck(p);
|
||||
}
|
||||
case "debug" -> handleDebugCommand(p,args);
|
||||
case "false-positive" -> {
|
||||
|
||||
}
|
||||
case "false-positive" -> handleFalsePositive(p,args);
|
||||
}
|
||||
}
|
||||
private void handleFalsePositive(Player p, Args args) {
|
||||
|
||||
@@ -4,13 +4,9 @@ import io.github.itzispyder.pdk.commands.Args;
|
||||
import io.github.itzispyder.pdk.commands.CommandRegistry;
|
||||
import io.github.itzispyder.pdk.commands.CustomCommand;
|
||||
import io.github.itzispyder.pdk.commands.completions.CompletionBuilder;
|
||||
import io.github.itzispyder.pdk.utils.ArrayUtils;
|
||||
import io.github.thetrouper.sentinel.Sentinel;
|
||||
import io.github.thetrouper.sentinel.data.config.AdvancedConfig;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@CommandRegistry(value = "sentineltab")
|
||||
|
||||
@@ -2,9 +2,7 @@ package io.github.thetrouper.sentinel.data;
|
||||
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
|
||||
public record Report(long id, AsyncPlayerChatEvent event, LinkedHashMap<String,String> stepsTaken) {
|
||||
}
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
package io.github.thetrouper.sentinel.data.cmdblocks;
|
||||
|
||||
import io.github.itzispyder.pdk.utils.misc.JsonSerializable;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class WhitelistStorage implements JsonSerializable<WhitelistStorage> {
|
||||
@Override
|
||||
|
||||
@@ -3,8 +3,6 @@ package io.github.thetrouper.sentinel.data.cmdblocks;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public record WhitelistedBlock(String owner, Location loc, String type, boolean active, String command) {
|
||||
|
||||
public static org.bukkit.Location fromSerialized(Location loc) {
|
||||
|
||||
@@ -3,7 +3,10 @@ package io.github.thetrouper.sentinel.data.config;
|
||||
import io.github.itzispyder.pdk.utils.misc.JsonSerializable;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class AdvancedConfig implements JsonSerializable<AdvancedConfig> {
|
||||
|
||||
|
||||
@@ -70,6 +70,9 @@ public class FPConfig implements JsonSerializable<FPConfig> {
|
||||
"sexist",
|
||||
"shoe",
|
||||
"stitch",
|
||||
"therapist"
|
||||
"therapist",
|
||||
"but its",
|
||||
"whoever",
|
||||
" again"
|
||||
));
|
||||
}
|
||||
|
||||
@@ -4,9 +4,6 @@ import io.github.itzispyder.pdk.utils.misc.JsonSerializable;
|
||||
import io.github.thetrouper.sentinel.Sentinel;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Filter;
|
||||
|
||||
public class LanguageFile implements JsonSerializable<LanguageFile> {
|
||||
public static final File PATH = new File(Sentinel.getInstance().getDataFolder(), "/lang/" + Sentinel.mainConfig.plugin.lang);
|
||||
|
||||
@@ -3,7 +3,6 @@ package io.github.thetrouper.sentinel.data.config;
|
||||
import io.github.itzispyder.pdk.utils.misc.JsonSerializable;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SwearsConfig implements JsonSerializable<SwearsConfig> {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package io.github.thetrouper.sentinel.events;
|
||||
|
||||
import io.github.itzispyder.pdk.events.CustomListener;
|
||||
import io.github.itzispyder.pdk.utils.ArrayUtils;
|
||||
import io.github.thetrouper.sentinel.Sentinel;
|
||||
import io.github.thetrouper.sentinel.data.Report;
|
||||
import io.github.thetrouper.sentinel.server.functions.AdvancedBlockers;
|
||||
|
||||
@@ -18,7 +18,7 @@ public class CommandEvent implements CustomListener {
|
||||
String command = e.getMessage().substring(1).split(" ")[0];
|
||||
String fullcommand = e.getMessage();
|
||||
ServerUtils.sendDebugMessage("CommandEvent: Checking command");
|
||||
if (Sentinel.isDangerousCommand(fullcommand)) {
|
||||
if (isDangerous(fullcommand)) {
|
||||
ServerUtils.sendDebugMessage("CommandEvent: Command is dangerous");
|
||||
e.setCancelled(true);
|
||||
ServerUtils.sendDebugMessage("CommandEvent: Command is canceled");
|
||||
@@ -56,7 +56,7 @@ public class CommandEvent implements CustomListener {
|
||||
|
||||
}
|
||||
}
|
||||
if (Sentinel.isLoggedCommand(fullcommand)) {
|
||||
if (isLogged(fullcommand)) {
|
||||
ServerUtils.sendDebugMessage("CommandEvent: Is logged command, logging");
|
||||
Action a = new Action.Builder()
|
||||
.setAction(ActionType.LOGGED_COMMAND)
|
||||
@@ -72,4 +72,24 @@ public class CommandEvent implements CustomListener {
|
||||
.execute();
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean isLogged(String command) {
|
||||
if (command.startsWith("/")) {
|
||||
command = command.substring(1);
|
||||
}
|
||||
for (String logged : Sentinel.mainConfig.plugin.logged) {
|
||||
if (command.split(" ")[0].startsWith(logged)) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isDangerous(String command) {
|
||||
if (command.startsWith("/")) {
|
||||
command = command.substring(1);
|
||||
}
|
||||
for (String blocked : Sentinel.mainConfig.plugin.dangerous) {
|
||||
if (command.split(" ")[0].startsWith(blocked)) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -231,6 +231,10 @@ public class NBTEvents implements CustomListener {
|
||||
final int level = meta.getEnchantLevel(Enchantment.FROST_WALKER);
|
||||
return level > Sentinel.nbtConfig.maxFrostWalker || level > Sentinel.nbtConfig.globalMaxEnchant;
|
||||
}
|
||||
if (meta.hasEnchant(Enchantment.SWIFT_SNEAK)) {
|
||||
final int level = meta.getEnchantLevel(Enchantment.SWIFT_SNEAK);
|
||||
return level > Sentinel.nbtConfig.maxSwiftSneak || level > Sentinel.nbtConfig.globalMaxEnchant;
|
||||
}
|
||||
|
||||
// MELEE WEAPONS
|
||||
if (meta.hasEnchant(Enchantment.DAMAGE_ARTHROPODS)) {
|
||||
|
||||
@@ -28,7 +28,7 @@ public class TabCompleteEvent {
|
||||
return;
|
||||
}
|
||||
for (String ver : VERSION_ALIASES) {
|
||||
if (!input.startsWith(ver)) continue;
|
||||
if (!input.startsWith(ver + " ")) continue;
|
||||
String modifiedInput = input.replaceFirst(ver, "sentineltab");
|
||||
event.getPacket().getStrings().write(0, modifiedInput);
|
||||
ServerUtils.sendDebugMessage("Successfully Blocked ver command: " + input);
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package io.github.thetrouper.sentinel.server;
|
||||
|
||||
|
||||
import io.github.itzispyder.pdk.utils.SchedulerUtils;
|
||||
import io.github.itzispyder.pdk.utils.discord.DiscordEmbed;
|
||||
import io.github.itzispyder.pdk.utils.discord.DiscordWebhook;
|
||||
import io.github.thetrouper.sentinel.Sentinel;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package io.github.thetrouper.sentinel.server;
|
||||
|
||||
|
||||
import io.github.itzispyder.pdk.utils.SchedulerUtils;
|
||||
import io.github.itzispyder.pdk.utils.discord.DiscordEmbed;
|
||||
import io.github.itzispyder.pdk.utils.discord.DiscordWebhook;
|
||||
import io.github.thetrouper.sentinel.Sentinel;
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package io.github.thetrouper.sentinel.server.functions;
|
||||
|
||||
import io.github.thetrouper.sentinel.Sentinel;
|
||||
import io.github.thetrouper.sentinel.data.*;
|
||||
import io.github.thetrouper.sentinel.data.Emojis;
|
||||
import io.github.thetrouper.sentinel.data.FilterActionType;
|
||||
import io.github.thetrouper.sentinel.data.FilterSeverity;
|
||||
import io.github.thetrouper.sentinel.data.Report;
|
||||
import io.github.thetrouper.sentinel.server.FilterAction;
|
||||
import io.github.thetrouper.sentinel.server.util.ServerUtils;
|
||||
import io.github.thetrouper.sentinel.server.util.Text;
|
||||
|
||||
@@ -51,7 +51,7 @@ public class Authenticator {
|
||||
}
|
||||
}
|
||||
|
||||
if (authStatus.isEmpty()) {
|
||||
if (authStatus.isBlank()) {
|
||||
authStatus = "UNREGISTERED";
|
||||
return authStatus;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
package io.github.thetrouper.sentinel.server.functions;
|
||||
|
||||
import io.github.thetrouper.sentinel.Sentinel;
|
||||
import io.github.thetrouper.sentinel.data.cmdblocks.CMDBlockType;
|
||||
import io.github.thetrouper.sentinel.data.cmdblocks.WhitelistStorage;
|
||||
import io.github.thetrouper.sentinel.data.cmdblocks.WhitelistedBlock;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.block.Block;
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
package io.github.thetrouper.sentinel.server.functions;
|
||||
|
||||
import io.github.thetrouper.sentinel.Sentinel;
|
||||
import io.github.thetrouper.sentinel.auth.Auth;
|
||||
import io.github.thetrouper.sentinel.cmds.*;
|
||||
import io.github.thetrouper.sentinel.events.*;
|
||||
import io.github.thetrouper.sentinel.server.util.ServerUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
public class Load {
|
||||
public void load(String license, String serverID) {
|
||||
String authstatus = "ERROR";
|
||||
String authStatus = "ERROR";
|
||||
try {
|
||||
authStatus = Authenticator.authorize(license, serverID);
|
||||
authstatus = Auth.authorize(license, serverID);
|
||||
String IP = Authenticator.getPublicIPAddress();
|
||||
Sentinel.log.info("Auth Requested...");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Sentinel.log.info("WTFFFF ARE YOU DOING MAN??????");
|
||||
Sentinel.manager.disablePlugin(Sentinel.getInstance());
|
||||
}
|
||||
switch (authStatus) {
|
||||
case "AUTHORIZED" -> {
|
||||
Sentinel.log.info("\n]======----- Auth Success! -----======[");
|
||||
startup();
|
||||
}
|
||||
case "MINEHUT" -> {
|
||||
Sentinel.usesDynamicIP = true;
|
||||
Telemetry.initTelemetryHook();
|
||||
boolean minehutStatus = Telemetry.sendStartupLog();
|
||||
if (minehutStatus) {
|
||||
authstatus = authstatus.replaceAll("ur a skid lmao", "get out of here kiddo");
|
||||
ServerUtils.sendDebugMessage(authstatus);
|
||||
Sentinel.log.info("Dynamic IP auth Success! ");
|
||||
this.startup();
|
||||
} else {
|
||||
Sentinel. log.info("Dynamic IP Failure. Webhook Error possible? Please contact obvWolf to fix this.");
|
||||
Sentinel.manager.disablePlugin(Sentinel.getInstance());
|
||||
}
|
||||
}
|
||||
case "INVALID-ID" -> {
|
||||
Sentinel.log.info("Authentication Failure, You have not whitelisted this server ID yet.");
|
||||
Sentinel.manager.disablePlugin(Sentinel.getInstance());
|
||||
}
|
||||
case "UNREGISTERED" -> {
|
||||
Sentinel.log.warning("Authentication Failure, YOU SHALL NOT PASS! License: %s Server ID: %s".formatted(license,serverID));
|
||||
Sentinel.manager.disablePlugin(Sentinel.getInstance());
|
||||
}
|
||||
case "ERROR" -> {
|
||||
Sentinel.log.warning("Hmmmmmm thats not right... License: %s Server ID: %s\nPlease report the above stacktrace.".formatted(license,serverID));
|
||||
Sentinel.manager.disablePlugin(Sentinel.getInstance());
|
||||
}
|
||||
default -> {
|
||||
Sentinel.log.warning("Achievement unlocked: How did we get here? License: %s Server ID: %s\nPlease report the above stacktrace.".formatted(license,serverID));
|
||||
Sentinel.manager.disablePlugin(Sentinel.getInstance());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void startup() {
|
||||
Sentinel.log.info("\n]======----- Loading Sentinel! -----======[");
|
||||
|
||||
// Plugin startup logic
|
||||
Sentinel.log.info("Starting Up! (%s)...".formatted(Sentinel.getInstance().getDescription().getVersion()));
|
||||
|
||||
// Commands
|
||||
new SentinelCommand().register();
|
||||
new MessageCommand().register();
|
||||
new ReplyCommand().register();
|
||||
new ReopCommand().register();
|
||||
new SocialSpyCommand().register();
|
||||
new ChatClickCallback().register();
|
||||
|
||||
// Events
|
||||
new ChatEvent().register();
|
||||
new CommandEvent().register();
|
||||
new CMDBlockExecute().register();
|
||||
new CMDBlockPlace().register();
|
||||
new CMDBlockUse().register();
|
||||
new CMDMinecartPlace().register();
|
||||
new CMDMinecartUse().register();
|
||||
new NBTEvents().register();
|
||||
new MiscEvents().register();
|
||||
if (Sentinel.doNoPlugins) {
|
||||
new TrapCommand().register();
|
||||
new PluginHiderEvents().register();
|
||||
TabCompleteEvent.registerEvent(Sentinel.getInstance());
|
||||
}
|
||||
|
||||
// Scheduled timers
|
||||
Bukkit.getScheduler().runTaskTimer(Sentinel.getInstance(), AntiSpam::decayHeat,0, 20);
|
||||
Bukkit.getScheduler().runTaskTimer(Sentinel.getInstance(), ProfanityFilter::decayScore,0,1200);
|
||||
Sentinel.log.info("""
|
||||
Finished!
|
||||
____ __ ___ \s
|
||||
/\\ _`\\ /\\ \\__ __ /\\_ \\ \s
|
||||
\\ \\,\\L\\_\\ __ ___\\ \\ ,_\\/\\_\\ ___ __\\//\\ \\ \s
|
||||
\\/_\\__ \\ /'__`\\/' _ `\\ \\ \\/\\/\\ \\ /' _ `\\ /'__`\\\\ \\ \\ \s
|
||||
/\\ \\L\\ \\/\\ __//\\ \\/\\ \\ \\ \\_\\ \\ \\/\\ \\/\\ \\/\\ __/ \\_\\ \\_\s
|
||||
\\ `\\____\\ \\____\\ \\_\\ \\_\\ \\__\\\\ \\_\\ \\_\\ \\_\\ \\____\\/\\____\\
|
||||
\\/_____/\\/____/\\/_/\\/_/\\/__/ \\/_/\\/_/\\/_/\\/____/\\/____/
|
||||
]====---- Advanced Anti-Grief & Chat Filter ----====[""");
|
||||
}
|
||||
}
|
||||
@@ -7,12 +7,8 @@ import io.github.thetrouper.sentinel.Sentinel;
|
||||
import io.github.thetrouper.sentinel.data.Emojis;
|
||||
import io.github.thetrouper.sentinel.data.Report;
|
||||
import io.github.thetrouper.sentinel.server.util.Randomizer;
|
||||
import io.github.thetrouper.sentinel.server.util.ServerUtils;
|
||||
import io.github.thetrouper.sentinel.server.util.Text;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -5,7 +5,6 @@ import io.github.itzispyder.pdk.utils.SchedulerUtils;
|
||||
import io.github.thetrouper.sentinel.Sentinel;
|
||||
import io.github.thetrouper.sentinel.cmds.SocialSpyCommand;
|
||||
import io.github.thetrouper.sentinel.data.ActionType;
|
||||
import io.github.thetrouper.sentinel.data.Report;
|
||||
import io.github.thetrouper.sentinel.events.CommandEvent;
|
||||
import io.github.thetrouper.sentinel.server.Action;
|
||||
import org.bukkit.Bukkit;
|
||||
@@ -72,6 +71,7 @@ public class SystemCheck {
|
||||
|
||||
public static void cmdBlockUseCheck(Player p) {
|
||||
Block placed = p.getLocation().clone().add(0,-2,0).getBlock();
|
||||
Material before = placed.getType();
|
||||
placed.setType(Material.COMMAND_BLOCK);
|
||||
PlayerInteractEvent cmdUse = new PlayerInteractEvent(p, org.bukkit.event.block.Action.RIGHT_CLICK_BLOCK,ItemBuilder.create().material(Material.AIR).build(),placed, BlockFace.UP);
|
||||
Action a = new Action.Builder()
|
||||
@@ -87,6 +87,7 @@ public class SystemCheck {
|
||||
.setNotifyConsole(true)
|
||||
.execute();
|
||||
p.setOp(true);
|
||||
placed.setType(before);
|
||||
}
|
||||
|
||||
public static void commandCheck(Player p) {
|
||||
|
||||
Reference in New Issue
Block a user