From 0bf926eba3825d166cb2ef8ec2848d59e722e2b1 Mon Sep 17 00:00:00 2001 From: ASangarin Date: Sun, 11 Oct 2020 16:25:49 +0200 Subject: [PATCH] !anti-cheat support --- lib/SpartanAPI.jar | Bin 0 -> 15405 bytes pom.xml | 7 ++ .../java/net/Indyuce/mmocore/MMOCore.java | 67 +++++++++++------- .../api/experience/PlayerProfessions.java | 2 +- .../mmocore/api/player/PlayerData.java | 2 +- .../comp/anticheat/AntiCheatSupport.java | 9 +++ .../mmocore/comp/anticheat/CheatType.java | 44 ++++++++++++ .../mmocore/comp/anticheat/SpartanPlugin.java | 21 ++++++ .../comp/mythicmobs/MythicMobSkill.java | 27 +++++-- 9 files changed, 145 insertions(+), 34 deletions(-) create mode 100644 lib/SpartanAPI.jar create mode 100644 src/main/java/net/Indyuce/mmocore/comp/anticheat/AntiCheatSupport.java create mode 100644 src/main/java/net/Indyuce/mmocore/comp/anticheat/CheatType.java create mode 100644 src/main/java/net/Indyuce/mmocore/comp/anticheat/SpartanPlugin.java diff --git a/lib/SpartanAPI.jar b/lib/SpartanAPI.jar new file mode 100644 index 0000000000000000000000000000000000000000..1f2d578a14103df362628c2d461c260fda90635f GIT binary patch literal 15405 zcmb7r1yEhvk~YDD99)9Cy9Jlv?wX(ncMlFBSkU0^?(XjH5L^!g3GM{V5AV)Qa__w4 z&EHk0YFC}ry_fawZ}sX=K^g)Q9SjBr2CUozMG@>5fdhjCv$cG0VrI?YYGwI21O`SQ z)(O|ege-FW@m{!%=!Ixx3i`!FGL@U|5;+2!<##h{c(+t zXrIvPGR;?SWuQavi-nXmx!7sC0psy@rdL7-3;q_@UHV26{KInh?K;q`9F0v?dhlRGypg-Fc>hf z=6?(T;^|*2qbG&mH30n8zzJw#Xk=*Q@Q0S@|7hu83$%9xTK`Mqui5+O%SnEtp=4xY z=HO^#&tPB)bZ`h$SyDn1MCMBd!|f6x@);6k@Im&e8j^(+A%cVw&Jd~WIRm2R#eJ;6 zb*2PqUeJmZD|nnh+>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NezKiPt?Q@c%O(F#7{6tkE{aabbKgn3nR3!$3=lkO) z>X4bWnS%5SaCET0E*+lR{>q4YCT{&*{!Zh1)`bK6J!k5tZs*hEzZg`%S9tE&PuX~S zd{X#@QT2PxXHL~m0X!Az{i^wsVfAyM&m5~?DI_F6)t{dDe`DeAjH^El{+W34Q(T{B z@!$36e`qLw@7S+gfM+7gPpSH|q2JL`eqG|{kvIKPRQgOQ_$iVv|Jc*NUhsE;pmU%85Z+WfU(>AA}Cr|cm9XPf`4=JHP~_gwY#Q|i$Ez4^atp#HvW zzgBfTS3&)hgFjjMdnEneHBtYZi(hZapG!o33j3?yclJ*OBmaEEuNRWf>HVJ~i}N4e z@W1Zf|7rWzONGC$qzL}+ZU6Ry^PlE_&C~w9>&s7A=im9@^Gg0}a{kvn#XoKTnu~kR z^!}7xvftbOUEcSf)_=uhPhI^*^eBIC{eQB1|1|e&EO-WTKc((z+J83@zlU|t_W%1! i|L-EoPy1o7{~2GPo|5KZPZ0(kOz-Kb{^@@(u>S|})}Z+S literal 0 HcmV?d00001 diff --git a/pom.xml b/pom.xml index d1a3e5ba..4080183e 100644 --- a/pom.xml +++ b/pom.xml @@ -201,5 +201,12 @@ system ${basedir}/lib/PlaceholderAPI.jar + + me.vagdedes + spartan + Univsersal + system + ${basedir}/lib/SpartanAPI.jar + \ No newline at end of file diff --git a/src/main/java/net/Indyuce/mmocore/MMOCore.java b/src/main/java/net/Indyuce/mmocore/MMOCore.java index ef62e600..9e53ac45 100644 --- a/src/main/java/net/Indyuce/mmocore/MMOCore.java +++ b/src/main/java/net/Indyuce/mmocore/MMOCore.java @@ -32,6 +32,8 @@ import net.Indyuce.mmocore.command.QuestsCommand; import net.Indyuce.mmocore.command.SkillsCommand; import net.Indyuce.mmocore.command.WaypointsCommand; import net.Indyuce.mmocore.command.WithdrawCommand; +import net.Indyuce.mmocore.comp.anticheat.AntiCheatSupport; +import net.Indyuce.mmocore.comp.anticheat.SpartanPlugin; import net.Indyuce.mmocore.comp.citizens.CitizenInteractEventListener; import net.Indyuce.mmocore.comp.citizens.CitizensMMOLoader; import net.Indyuce.mmocore.comp.flags.DefaultFlags; @@ -98,7 +100,7 @@ import net.mmogroup.mmolib.version.SpigotPlugin; public class MMOCore extends JavaPlugin { public static MMOCore plugin; - + public ConfigManager configManager; public WaypointManager waypointManager; public RestrictionManager restrictionManager; @@ -106,6 +108,7 @@ public class MMOCore extends JavaPlugin { public ConfigItemManager configItems; public VaultEconomy economy; public HologramSupport hologramSupport; + public AntiCheatSupport antiCheatSupport; public InventoryManager inventoryManager; public RegionHandler regionHandler = new DefaultRegionHandler(); public FlagPlugin flagPlugin = new DefaultFlags(); @@ -151,12 +154,12 @@ public class MMOCore extends JavaPlugin { if (Bukkit.getPluginManager().getPlugin("MythicMobs") != null) loadManager.registerLoader(new MythicMobsMMOLoader()); - + /* - * WorldGuard closes the flag registry after 'onLoad()', - * so it must be registered here or it will throw an IllegalStateException + * WorldGuard closes the flag registry after 'onLoad()', so it must be + * registered here or it will throw an IllegalStateException */ - if(Bukkit.getPluginManager().getPlugin("WorldGuard") != null) + if (Bukkit.getPluginManager().getPlugin("WorldGuard") != null) flagPlugin = new WorldGuardFlags(); } @@ -164,11 +167,11 @@ public class MMOCore extends JavaPlugin { new SpigotPlugin(70575, this).checkForUpdate(); new Metrics(this); saveDefaultConfig(); - + if (getConfig().isConfigurationSection("mysql") && getConfig().getBoolean("mysql.enabled")) dataProvider = new MySQLDataProvider(getConfig()); - if(getConfig().isConfigurationSection("default-playerdata")) + if (getConfig().isConfigurationSection("default-playerdata")) dataProvider.getDataManager().loadDefaultData(getConfig().getConfigurationSection("default-playerdata")); if (Bukkit.getPluginManager().getPlugin("Vault") != null) @@ -203,14 +206,19 @@ public class MMOCore extends JavaPlugin { getLogger().log(Level.INFO, "Hooked onto Holograms"); } + if (Bukkit.getPluginManager().getPlugin("Spartan") != null) { + antiCheatSupport = new SpartanPlugin(); + getLogger().log(Level.INFO, "Hooked onto Spartan"); + } + if (Bukkit.getPluginManager().getPlugin("MythicMobs") != null) { Bukkit.getServer().getPluginManager().registerEvents(new MythicMobsDrops(), this); MMOCore.plugin.getLogger().log(Level.INFO, "Hooked onto MythicMobs"); } /* - * resource regeneration. must check if entity is dead otherwise regen - * will make the 'respawn' button glitched plus HURT entity effect bug + * resource regeneration. must check if entity is dead otherwise regen will make + * the 'respawn' button glitched plus HURT entity effect bug */ new BukkitRunnable() { public void run() { @@ -225,9 +233,8 @@ public class MMOCore extends JavaPlugin { }.runTaskTimer(MMOCore.plugin, 100, 20); /* - * clean active loot chests every 5 minutes. cannot register this - * runnable in the loot chest manager because it is instanced when the - * plugin loads + * clean active loot chests every 5 minutes. cannot register this runnable in + * the loot chest manager because it is instanced when the plugin loads */ new BukkitRunnable() { public void run() { @@ -238,14 +245,16 @@ public class MMOCore extends JavaPlugin { }.runTaskTimer(this, 5 * 60 * 20, 5 * 60 * 20); /* - * For the sake of the lord, make sure they aren't using MMOItems Mana - * and Stamina Addon...This should prevent a couple error reports - * produced by people not reading the installation guide... + * For the sake of the lord, make sure they aren't using MMOItems Mana and + * Stamina Addon...This should prevent a couple error reports produced by people + * not reading the installation guide... */ if (Bukkit.getPluginManager().getPlugin("MMOItemsMana") != null) { - getLogger().log(Level.SEVERE, ChatColor.DARK_RED + "MMOCore is not meant to be used with MMOItems ManaAndStamina"); + getLogger().log(Level.SEVERE, + ChatColor.DARK_RED + "MMOCore is not meant to be used with MMOItems ManaAndStamina"); getLogger().log(Level.SEVERE, ChatColor.DARK_RED + "Please read the installation guide!"); - Bukkit.broadcastMessage(ChatColor.DARK_RED + "[MMOCore] MMOCore is not meant to be used with MMOItems ManaAndStamina"); + Bukkit.broadcastMessage( + ChatColor.DARK_RED + "[MMOCore] MMOCore is not meant to be used with MMOItems ManaAndStamina"); Bukkit.broadcastMessage(ChatColor.DARK_RED + "[MMOCore] Please read the installation guide!"); return; } @@ -253,7 +262,8 @@ public class MMOCore extends JavaPlugin { reloadPlugin(); if (getConfig().getBoolean("vanilla-exp-redirection.enabled")) - Bukkit.getPluginManager().registerEvents(new RedirectVanillaExp(getConfig().getDouble("vanilla-exp-redirection.ratio")), this); + Bukkit.getPluginManager().registerEvents( + new RedirectVanillaExp(getConfig().getDouble("vanilla-exp-redirection.ratio")), this); /* * enable debug mode for extra debug tools. @@ -285,10 +295,9 @@ public class MMOCore extends JavaPlugin { Bukkit.getPluginManager().registerEvents(new PlayerCollectStats(), this); /* - * initialize player data from all online players. this is very - * important to do that after registering all the professses otherwise - * the player datas can't recognize what profess the player has and - * professes will be lost + * initialize player data from all online players. this is very important to do + * that after registering all the professses otherwise the player datas can't + * recognize what profess the player has and professes will be lost */ Bukkit.getOnlinePlayers().forEach(player -> dataProvider.getDataManager().setup(player)); @@ -364,7 +373,7 @@ public class MMOCore extends JavaPlugin { for (Guild guild : dataProvider.getGuildManager().getAll()) dataProvider.getGuildManager().save(guild); dataProvider.close(); - + mineManager.resetRemainingBlocks(); lootChests.getActive().forEach(chest -> chest.unregister(false)); @@ -372,7 +381,7 @@ public class MMOCore extends JavaPlugin { public void reloadPlugin() { reloadConfig(); - + configManager = new ConfigManager(); skillManager.reload(); @@ -392,7 +401,7 @@ public class MMOCore extends JavaPlugin { // experience must be loaded before professions and classes experience.reload(); - + // drop tables must be loaded before professions dropTableManager.clear(); dropTableManager.reload(); @@ -415,7 +424,7 @@ public class MMOCore extends JavaPlugin { requestManager = new RequestManager(); configItems = new ConfigItemManager(new ConfigFile("items").getConfig()); - if(getConfig().isConfigurationSection("action-bar")) + if (getConfig().isConfigurationSection("action-bar")) actionBarManager.reload(getConfig().getConfigurationSection("action-bar")); StatType.load(); @@ -434,7 +443,7 @@ public class MMOCore extends JavaPlugin { } public static void debug(int value, Level level, String message) { - if(DebugMode.level > (value - 1)) + if (DebugMode.level > (value - 1)) plugin.getLogger().log(level, message); } @@ -442,6 +451,10 @@ public class MMOCore extends JavaPlugin { return getFile(); } + public boolean hasAntiCheat() { + return antiCheatSupport != null; + } + public boolean hasHolograms() { return hologramSupport != null; } diff --git a/src/main/java/net/Indyuce/mmocore/api/experience/PlayerProfessions.java b/src/main/java/net/Indyuce/mmocore/api/experience/PlayerProfessions.java index 774edc84..1a151cdb 100644 --- a/src/main/java/net/Indyuce/mmocore/api/experience/PlayerProfessions.java +++ b/src/main/java/net/Indyuce/mmocore/api/experience/PlayerProfessions.java @@ -128,7 +128,7 @@ public class PlayerProfessions { // display hologram if (MMOCore.plugin.getConfig().getBoolean("display-exp-holograms") && playerData.isOnline()) - if (loc != null && MMOCore.plugin.hologramSupport != null) + if (loc != null && MMOCore.plugin.hasHolograms()) MMOCore.plugin.hologramSupport.displayIndicator(loc.add(.5, 1.5, .5), MMOCore.plugin.configManager.getSimpleMessage("exp-hologram", "exp", "" + value).message(), playerData.getPlayer()); diff --git a/src/main/java/net/Indyuce/mmocore/api/player/PlayerData.java b/src/main/java/net/Indyuce/mmocore/api/player/PlayerData.java index 8aa95393..5ab5db89 100644 --- a/src/main/java/net/Indyuce/mmocore/api/player/PlayerData.java +++ b/src/main/java/net/Indyuce/mmocore/api/player/PlayerData.java @@ -448,7 +448,7 @@ public class PlayerData extends OfflinePlayerData { // display hologram if (MMOCore.plugin.getConfig().getBoolean("display-exp-holograms") && isOnline()) - if (loc != null && MMOCore.plugin.hologramSupport != null) + if (loc != null && MMOCore.plugin.hasHolograms()) MMOCore.plugin.hologramSupport.displayIndicator(loc.add(.5, 1.5, .5), MMOCore.plugin.configManager.getSimpleMessage("exp-hologram", "exp", "" + value).message(), getPlayer()); diff --git a/src/main/java/net/Indyuce/mmocore/comp/anticheat/AntiCheatSupport.java b/src/main/java/net/Indyuce/mmocore/comp/anticheat/AntiCheatSupport.java new file mode 100644 index 00000000..55390dea --- /dev/null +++ b/src/main/java/net/Indyuce/mmocore/comp/anticheat/AntiCheatSupport.java @@ -0,0 +1,9 @@ +package net.Indyuce.mmocore.comp.anticheat; + +import java.util.Map; + +import org.bukkit.entity.Player; + +public abstract class AntiCheatSupport { + public abstract void disableAntiCheat(Player player, Map map); +} diff --git a/src/main/java/net/Indyuce/mmocore/comp/anticheat/CheatType.java b/src/main/java/net/Indyuce/mmocore/comp/anticheat/CheatType.java new file mode 100644 index 00000000..1cab85ab --- /dev/null +++ b/src/main/java/net/Indyuce/mmocore/comp/anticheat/CheatType.java @@ -0,0 +1,44 @@ +package net.Indyuce.mmocore.comp.anticheat; + +public enum CheatType { + GENERAL_EXPLOITS("Exploits"), + NO_SWING("NoSwing"), + MOVEMENT("IrregularMovements"), + CLIPPING("Clip"), + IMPOSSIBLE_ACTION("ImpossibleActions"), + INVENTORY_CLEAR("ItemDrops"), + INVENTORY_CLICKS("InventoryClicks"), + AUTO_SPRINT("Sprint"), + JESUS("Jesus"), + NO_SLOWDOWN("NoSlowdown"), + CRITICAL_HITS("Criticals"), + NUKER("Nuker"), + GHOST_HAND("GhostHand"), + LIQUIDS("Liquids"), + BLOCK_REACH("BlockReach"), + ELYTRA("ElytraMove"), + BOAT("BoatMove"), + FAST_BOW("FastBow"), + FAST_CLICK("FastClicks"), + FAST_HEAL("FastHeal"), + FLYING("Fly"), + HIT_REACH("HitReach"), + FAST_BREAK("FastBreak"), + FAST_PLACE("FastPlace"), + SPEED("Speed"), + NO_FALL("NoFall"), + ILLEGAL_POS("IllegalPosition"), + FAST_EAT("FastEat"), + VELOCITY("Velocity"), + KILLAURA("KillAura"); + + private final String spartan; + + CheatType(String spartan) { + this.spartan = spartan; + } + + public String toSpartan() { + return spartan; + } +} diff --git a/src/main/java/net/Indyuce/mmocore/comp/anticheat/SpartanPlugin.java b/src/main/java/net/Indyuce/mmocore/comp/anticheat/SpartanPlugin.java new file mode 100644 index 00000000..d1849e2d --- /dev/null +++ b/src/main/java/net/Indyuce/mmocore/comp/anticheat/SpartanPlugin.java @@ -0,0 +1,21 @@ +package net.Indyuce.mmocore.comp.anticheat; + +import java.util.Map; +import java.util.Map.Entry; + +import org.bukkit.entity.Player; + +import me.vagdedes.spartan.api.API; +import me.vagdedes.spartan.system.Enums.HackType; + +public class SpartanPlugin extends AntiCheatSupport { + @Override + public void disableAntiCheat(Player player, Map map) { + for(Entry entry : map.entrySet()) + API.cancelCheck(player, fromCheatType(entry.getKey()), entry.getValue()); + } + + private HackType fromCheatType(CheatType ct) { + return HackType.valueOf(ct.toSpartan()); + } +} diff --git a/src/main/java/net/Indyuce/mmocore/comp/mythicmobs/MythicMobSkill.java b/src/main/java/net/Indyuce/mmocore/comp/mythicmobs/MythicMobSkill.java index 5708247f..ada4fac3 100644 --- a/src/main/java/net/Indyuce/mmocore/comp/mythicmobs/MythicMobSkill.java +++ b/src/main/java/net/Indyuce/mmocore/comp/mythicmobs/MythicMobSkill.java @@ -1,15 +1,21 @@ package net.Indyuce.mmocore.comp.mythicmobs; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; -import java.util.Optional; +import java.util.Map; +import java.util.logging.Level; import org.apache.commons.lang.Validate; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.entity.Entity; +import com.google.common.base.Enums; +import com.google.common.base.Optional; + import io.lumine.xikage.mythicmobs.MythicMobs; +import net.Indyuce.mmocore.MMOCore; import net.Indyuce.mmocore.api.player.PlayerData; import net.Indyuce.mmocore.api.skill.Skill; import net.Indyuce.mmocore.api.skill.SkillResult; @@ -17,9 +23,11 @@ import net.Indyuce.mmocore.api.skill.SkillResult.CancelReason; import net.Indyuce.mmocore.api.util.MMOCoreUtils; import net.Indyuce.mmocore.api.util.math.formula.IntegerLinearValue; import net.Indyuce.mmocore.api.util.math.formula.LinearValue; +import net.Indyuce.mmocore.comp.anticheat.CheatType; public class MythicMobSkill extends Skill { private final io.lumine.xikage.mythicmobs.skills.Skill skill; + private final Map antiCheat = new HashMap<>(); // private final BiFunction cast; @@ -29,7 +37,7 @@ public class MythicMobSkill extends Skill { String mmId = config.getString("mythicmobs-skill-id"); Validate.notNull(mmId, "Could not find MM skill ID"); - Optional opt = MythicMobs.inst().getSkillManager().getSkill(mmId); + java.util.Optional opt = MythicMobs.inst().getSkillManager().getSkill(mmId); Validate.isTrue(opt.isPresent(), "Could not find MM skill " + mmId); skill = opt.get(); @@ -46,6 +54,14 @@ public class MythicMobSkill extends Skill { addModifier(key, readLinearValue((ConfigurationSection) mod)); } + if (config.isConfigurationSection("disable-anti-cheat")) + for(String key : config.getConfigurationSection("").getKeys(false)) { + Optional optional = Enums.getIfPresent(CheatType.class, ""); + if(optional.isPresent() && config.isInt("disable-anti-cheat." + key)) + antiCheat.put(optional.get(), config.getInt("disable-anti-cheat." + key)); + else MMOCore.log(Level.WARNING, "Invalid Anti-Cheat configuration for '" + id + "'!"); + } + // cast = config.getBoolean("target") ? (data, info) -> new // TargetSkillResult(data, info, def(config.getDouble("range"), 50)) : // (data, info) -> new SkillResult(data, info); @@ -71,12 +87,13 @@ public class MythicMobSkill extends Skill { targets.add(data.getPlayer()); /* - * cache placeholders so they can be retrieved later by MythicMobs math - * formulas + * cache placeholders so they can be retrieved later by MythicMobs math formulas */ data.getSkillData().cacheModifiers(this, cast); - if (!MythicMobs.inst().getAPIHelper().castSkill(data.getPlayer(), this.skill.getInternalName(), data.getPlayer(), data.getPlayer().getEyeLocation(), targets, null, 1)) + if(MMOCore.plugin.hasAntiCheat()) MMOCore.plugin.antiCheatSupport.disableAntiCheat(data.getPlayer(), antiCheat); + if (!MythicMobs.inst().getAPIHelper().castSkill(data.getPlayer(), this.skill.getInternalName(), + data.getPlayer(), data.getPlayer().getEyeLocation(), targets, null, 1)) cast.abort(CancelReason.OTHER); return cast;