Skip to content

Commit

Permalink
Remove AC Support (#864)
Browse files Browse the repository at this point in the history
Remove anti-cheat support because the anti-cheat version does not support the latest Minecraft versions.
  • Loading branch information
TrueDarkLord authored Oct 29, 2024
1 parent 5197b99 commit 922ba21
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 75 deletions.
5 changes: 0 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ plotsquared = "7.3.11" # https://intellectualsites.gitbook.io/plotsqua
mcmmo = "2.1.227" # https://repo.codemc.io/service/rest/repository/browse/maven-public/com/gmail/nossr50/mcMMO/mcMMO/
kingdoms = "1.16.20.5" # https://www.spigotmc.org/resources/kingdomsx.77670/

# AniCheat
nocheatsplus = "3.16.1-SNAPSHOT" # https://ci.codemc.io/job/Updated-NoCheatPlus/

# Libraries
triumph-cmd = "2.0.0-ALPHA-10" # Version=MIA https://github.com/TriumphTeam/triumph-cmds?tab=readme-ov-file
tirumph-gui = "3.1.10" # https://mvnrepository.com/artifact/dev.triumphteam/triumph-gui
Expand Down Expand Up @@ -77,7 +74,5 @@ kingdoms = { module = "com.github.cryptomorin:kingdoms", version.ref = "kingdoms
informative-annotations = { group = "com.intellectualsites.informative-annotations", name = "informative-annotations", version = "1.5" } #https://central.sonatype.com/artifact/com.intellectualsites.informative-annotations/informative-annotations
paster = { group = "com.intellectualsites.paster", name = "Paster", version = "1.1.6" } #https://mvnrepository.com/artifact/com.intellectualsites.paster

nocheatplus = { module = "fr.neatmonster:nocheatplus", version.ref = "nocheatsplus" }

[bundles]
triumph = ["triumph-cmds", "triumph-gui"]
2 changes: 0 additions & 2 deletions paper/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ dependencies {

compileOnly(libs.griefprevention)

//compileOnly(libs.nocheatplus)

compileOnly(libs.oraxen)

compileOnly(libs.worldguard)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import com.badbones69.crazyenchantments.paper.support.PluginSupport;
import com.badbones69.crazyenchantments.paper.support.PluginSupport.SupportedPlugins;
import com.badbones69.crazyenchantments.paper.support.SkullCreator;
import com.badbones69.crazyenchantments.paper.support.anticheats.NoCheatPlusSupport;
import com.badbones69.crazyenchantments.paper.support.claims.SuperiorSkyBlockSupport;
import com.badbones69.crazyenchantments.paper.support.misc.OraxenSupport;
import org.bukkit.plugin.java.JavaPlugin;
Expand Down Expand Up @@ -50,7 +49,6 @@ public class Starter {
private PluginSupport pluginSupport;
private VaultSupport vaultSupport;
private OraxenSupport oraxenSupport;
private NoCheatPlusSupport noCheatPlusSupport;

// Plugin Managers.
private ArmorEnchantmentManager armorEnchantmentManager;
Expand Down Expand Up @@ -78,8 +76,6 @@ public void run() {

if (SupportedPlugins.SUPERIORSKYBLOCK.isPluginLoaded()) this.superiorSkyBlockSupport = new SuperiorSkyBlockSupport();

if (SupportedPlugins.NO_CHEAT_PLUS.isPluginLoaded()) this.noCheatPlusSupport = new NoCheatPlusSupport();

if (SupportedPlugins.ORAXEN.isPluginLoaded()) this.oraxenSupport = new OraxenSupport();

// Methods
Expand Down Expand Up @@ -170,10 +166,6 @@ public OraxenSupport getOraxenSupport() {
return this.oraxenSupport;
}

public NoCheatPlusSupport getNoCheatPlusSupport() {
return this.noCheatPlusSupport;
}

// Economy Management.
public CurrencyAPI getCurrencyAPI() {
return this.currencyAPI;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
import com.badbones69.crazyenchantments.paper.controllers.settings.EnchantmentBookSettings;
import com.badbones69.crazyenchantments.paper.controllers.settings.ProtectionCrystalSettings;
import com.badbones69.crazyenchantments.paper.support.PluginSupport;
import com.badbones69.crazyenchantments.paper.support.PluginSupport.SupportedPlugins;
import com.badbones69.crazyenchantments.paper.support.anticheats.NoCheatPlusSupport;
import com.badbones69.crazyenchantments.paper.tasks.processors.ArmorProcessor;
import com.destroystokyo.paper.event.player.PlayerArmorChangeEvent;
import org.bukkit.Location;
Expand Down Expand Up @@ -71,9 +69,6 @@ public class ArmorEnchantments implements Listener {
private final EnchantmentBookSettings enchantmentBookSettings = this.starter.getEnchantmentBookSettings();

// Plugin Support.
@NotNull
private final NoCheatPlusSupport noCheatPlusSupport = this.starter.getNoCheatPlusSupport();

@NotNull
private final PluginSupport pluginSupport = this.starter.getPluginSupport();

Expand Down Expand Up @@ -300,16 +295,11 @@ public void onPlayerDamage(EntityDamageByEntityEvent event) {
if (EnchantUtils.isEventActive(CEnchantments.STORMCALLER, player, armor, enchants)) {
Entity lightning = this.methods.lightning(damager);

// AntiCheat Support.
//if (SupportedPlugins.NO_CHEAT_PLUS.isPluginLoaded()) this.noCheatPlusSupport.allowPlayer(player);

for (LivingEntity en : this.methods.getNearbyLivingEntities(2D, player)) {
EntityDamageEvent damageByEntityEvent = new EntityDamageEvent(en, DamageCause.LIGHTNING, DamageSource.builder(DamageType.LIGHTNING_BOLT).withCausingEntity(player).withDirectEntity(lightning).build(), 5D);
this.methods.entityEvent(player, en, damageByEntityEvent);
}

//if (SupportedPlugins.NO_CHEAT_PLUS.isPluginLoaded()) this.noCheatPlusSupport.allowPlayer(player);

damager.damage(5D);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import com.badbones69.crazyenchantments.paper.Starter;
import com.badbones69.crazyenchantments.paper.api.FileManager.Files;
import com.badbones69.crazyenchantments.paper.api.enums.CEnchantments;
import com.badbones69.crazyenchantments.paper.api.events.EnchantmentUseEvent;
import com.badbones69.crazyenchantments.paper.api.managers.BowEnchantmentManager;
import com.badbones69.crazyenchantments.paper.api.objects.BowEnchantment;
import com.badbones69.crazyenchantments.paper.api.objects.CEnchantment;
Expand All @@ -15,8 +14,6 @@
import com.badbones69.crazyenchantments.paper.api.utils.EventUtils;
import com.badbones69.crazyenchantments.paper.controllers.settings.EnchantmentBookSettings;
import com.badbones69.crazyenchantments.paper.support.PluginSupport;
import com.badbones69.crazyenchantments.paper.support.PluginSupport.SupportedPlugins;
import com.badbones69.crazyenchantments.paper.support.anticheats.NoCheatPlusSupport;
import org.bukkit.Location;
import org.bukkit.Sound;
import org.bukkit.attribute.Attribute;
Expand Down Expand Up @@ -61,9 +58,6 @@ public class BowEnchantments implements Listener {
@NotNull
private final PluginSupport pluginSupport = this.starter.getPluginSupport();

@NotNull
private final NoCheatPlusSupport noCheatPlusSupport = this.starter.getNoCheatPlusSupport();

// Plugin Managers.
@NotNull
private final BowEnchantmentManager bowEnchantmentManager = this.starter.getBowEnchantmentManager();
Expand Down Expand Up @@ -126,9 +120,6 @@ public void onLand(ProjectileHitEvent event) {
} catch (Exception ignore) {
}

// AntiCheat Support.
//if (SupportedPlugins.NO_CHEAT_PLUS.isPluginLoaded()) this.noCheatPlusSupport.allowPlayer(shooter);

for (LivingEntity entity : this.methods.getNearbyLivingEntities(2D, enchantedArrow.arrow())) {
EntityDamageEvent damageByEntityEvent = new EntityDamageEvent(entity, DamageCause.LIGHTNING, DamageSource.builder(DamageType.LIGHTNING_BOLT).withCausingEntity(shooter).withDirectEntity(lightning).build(), 5D);

Expand All @@ -143,7 +134,6 @@ public void onLand(ProjectileHitEvent event) {
EventUtils.removeIgnoredUUID(shooter.getUniqueId());
}

//if (SupportedPlugins.NO_CHEAT_PLUS.isPluginLoaded()) this.noCheatPlusSupport.denyPlayer(shooter);
}

// Removes the arrow from the list after 5 ticks. This is done because the onArrowDamage event needs the arrow in the list, so it can check.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
import com.badbones69.crazyenchantments.paper.api.utils.EnchantUtils;
import com.badbones69.crazyenchantments.paper.api.utils.EventUtils;
import com.badbones69.crazyenchantments.paper.controllers.settings.EnchantmentBookSettings;
import com.badbones69.crazyenchantments.paper.support.PluginSupport.SupportedPlugins;
import com.badbones69.crazyenchantments.paper.support.anticheats.NoCheatPlusSupport;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
Expand Down Expand Up @@ -52,10 +50,6 @@ public class PickaxeEnchantments implements Listener {
@NotNull
private final EnchantmentBookSettings enchantmentBookSettings = this.starter.getEnchantmentBookSettings();

// Plugin Support.
@NotNull
private final NoCheatPlusSupport noCheatPlusSupport = this.starter.getNoCheatPlusSupport();

private final HashMap<Player, HashMap<Block, BlockFace>> blocks = new HashMap<>();

@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
Expand Down Expand Up @@ -100,8 +94,6 @@ public void onBlastBreak(BlockBreakEvent event) {
if (damage) this.methods.removeDurability(currentItem, player);
}
if (!damage) this.methods.removeDurability(currentItem, player);

antiCheat(player);
}


Expand Down Expand Up @@ -134,9 +126,6 @@ public void onVeinMinerBreak(BlockBreakEvent event) {
}

if (!damage) this.methods.removeDurability(currentItem, player);

antiCheat(player);

}

private boolean massBlockBreakCheck(Player player, Set<Block> blockList) {
Expand All @@ -146,10 +135,6 @@ private boolean massBlockBreakCheck(Player player, Set<Block> blockList) {
return event.isCancelled();
}

private void antiCheat(Player player) {
//if (SupportedPlugins.NO_CHEAT_PLUS.isPluginLoaded()) this.noCheatPlusSupport.allowPlayer(player);
}

@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onDropAlter(BlockDropItemEvent event) {
if (!isOreBlock(event.getBlockState().getType())) return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
import com.badbones69.crazyenchantments.paper.controllers.settings.EnchantmentBookSettings;
import com.badbones69.crazyenchantments.paper.scheduler.FoliaRunnable;
import com.badbones69.crazyenchantments.paper.support.PluginSupport;
import com.badbones69.crazyenchantments.paper.support.PluginSupport.SupportedPlugins;
import com.badbones69.crazyenchantments.paper.support.anticheats.NoCheatPlusSupport;
import org.bukkit.Material;
import org.bukkit.attribute.Attribute;
import org.bukkit.damage.DamageSource;
Expand Down Expand Up @@ -69,9 +67,6 @@ public class SwordEnchantments implements Listener {
@NotNull
private final PluginSupport pluginSupport = this.starter.getPluginSupport();

@NotNull
private final NoCheatPlusSupport noCheatPlusSupport = this.starter.getNoCheatPlusSupport();

@NotNull
private final BossBarController bossBarController = this.plugin.getBossBarController();

Expand Down Expand Up @@ -273,7 +268,6 @@ public void run() {
}

if (EnchantUtils.isEventActive(CEnchantments.PARALYZE, damager, item, enchantments)) {
//if (SupportedPlugins.NO_CHEAT_PLUS.isPluginLoaded()) this.noCheatPlusSupport.allowPlayer(damager);

for (LivingEntity entity : this.methods.getNearbyLivingEntities(2D, damager)) {
EntityDamageEvent damageByEntityEvent = new EntityDamageEvent(entity, EntityDamageEvent.DamageCause.MAGIC, DamageSource.builder(DamageType.INDIRECT_MAGIC).withDirectEntity(damager).build(), 5D);
Expand All @@ -283,8 +277,6 @@ public void run() {
en.getWorld().strikeLightningEffect(en.getLocation());
en.addPotionEffect(new PotionEffect(PotionEffectType.SLOWNESS, 3 * 20, 2));
en.addPotionEffect(new PotionEffect(PotionEffectType.MINING_FATIGUE, 3 * 20, 2));

//if (SupportedPlugins.NO_CHEAT_PLUS.isPluginLoaded()) this.noCheatPlusSupport.denyPlayer(damager);
}

if (EnchantUtils.isEventActive(CEnchantments.SLOWMO, damager, item, enchantments)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,6 @@ public enum SupportedPlugins {
// Random Plugins
MCMMO("McMMO"),

// Anti Cheats
NO_CHEAT_PLUS("NoCheatPlus"),

// Faction Plugins
FACTIONS_UUID("Factions"),

Expand Down

This file was deleted.

0 comments on commit 922ba21

Please sign in to comment.