diff --git a/eco-core/core-plugin/src/main/java/com/willfp/eco/spigot/EcoSpigotPlugin.java b/eco-core/core-plugin/src/main/java/com/willfp/eco/spigot/EcoSpigotPlugin.java index 1619c8bb..6f8b6a4c 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/eco/spigot/EcoSpigotPlugin.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/eco/spigot/EcoSpigotPlugin.java @@ -25,9 +25,7 @@ import com.willfp.eco.spigot.eventlisteners.ArmorListener; import com.willfp.eco.spigot.eventlisteners.DispenserArmorListener; import com.willfp.eco.spigot.eventlisteners.EntityDeathByEntityListeners; import com.willfp.eco.spigot.eventlisteners.NaturalExpGainListeners; -import com.willfp.eco.spigot.integrations.anticheat.AnticheatAAC; -import com.willfp.eco.spigot.integrations.anticheat.AnticheatMatrix; -import com.willfp.eco.spigot.integrations.anticheat.AnticheatNCP; +import com.willfp.eco.spigot.integrations.anticheat.*; import com.willfp.eco.spigot.integrations.antigrief.AntigriefCombatLogX; import com.willfp.eco.spigot.integrations.antigrief.AntigriefFactionsUUID; import com.willfp.eco.spigot.integrations.antigrief.AntigriefGriefPrevention; @@ -132,6 +130,8 @@ public class EcoSpigotPlugin extends EcoPlugin { new IntegrationLoader("AAC5", () -> AnticheatManager.register(this, new AnticheatAAC())), new IntegrationLoader("Matrix", () -> AnticheatManager.register(this, new AnticheatMatrix())), new IntegrationLoader("NoCheatPlus", () -> AnticheatManager.register(this, new AnticheatNCP())), + new IntegrationLoader("Spartan", () -> AnticheatManager.register(this, new AnticheatSpartan())), + new IntegrationLoader("Vulcan", () -> AnticheatManager.register(this, new AnticheatVulcan())), // Misc new IntegrationLoader("mcMMO", () -> McmmoManager.register(new McmmoIntegrationImpl())) diff --git a/eco-core/core-plugin/src/main/java/com/willfp/eco/spigot/integrations/anticheat/AnticheatVulcan.java b/eco-core/core-plugin/src/main/java/com/willfp/eco/spigot/integrations/anticheat/AnticheatVulcan.java new file mode 100644 index 00000000..bd56ac0f --- /dev/null +++ b/eco-core/core-plugin/src/main/java/com/willfp/eco/spigot/integrations/anticheat/AnticheatVulcan.java @@ -0,0 +1,44 @@ +package com.willfp.eco.spigot.integrations.anticheat; + +import com.willfp.eco.core.integrations.anticheat.AnticheatWrapper; +import me.frep.vulcan.api.event.VulcanFlagEvent; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.jetbrains.annotations.NotNull; + +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; + +public class AnticheatVulcan implements AnticheatWrapper, Listener { + /** + * Currently exempt players. + */ + private final Set exempt = new HashSet<>(); + + @Override + public String getPluginName() { + return "Vulcan"; + } + + @Override + public void exempt(@NotNull final Player player) { + this.exempt.add(player.getUniqueId()); + } + + @Override + public void unexempt(@NotNull final Player player) { + this.exempt.remove(player.getUniqueId()); + } + + @EventHandler(priority = EventPriority.LOWEST) + private void onViolate(@NotNull final VulcanFlagEvent event) { + if (!exempt.contains(event.getPlayer().getUniqueId())) { + return; + } + + event.setCancelled(true); + } +} diff --git a/lib/VulcanAPI.jar b/lib/VulcanAPI.jar new file mode 100644 index 00000000..d19cad63 Binary files /dev/null and b/lib/VulcanAPI.jar differ