Another small fix for mcMMO compatibility, also updated to 1.2

This commit is contained in:
H31IX committed 2012-06-02 13:55:46 -04:00
1 parent 4e27dacab3
commit b57883e795
6 files changed
+12 -9

No files matched your search

+1 -1
View File
@@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>net.h31ix.anticheat</groupId> <groupId>net.h31ix.anticheat</groupId>
<artifactId>AntiCheat</artifactId> <artifactId>AntiCheat</artifactId>
<version>1.1</version> <version>1.2</version>
<name>AntiCheat</name> <name>AntiCheat</name>
<url>http://H31IX.NET/</url> <url>http://H31IX.NET/</url>
<repositories> <repositories>
@@ -86,7 +86,7 @@ public class BlockListener extends EventListener
if(checkManager.willCheck(player, CheckType.LONG_REACH)) if(checkManager.willCheck(player, CheckType.LONG_REACH))
{ {
Distance distance = new Distance(player.getLocation(),block.getLocation()); Distance distance = new Distance(player.getLocation(),block.getLocation());
if(backend.checkLongReachBlock(distance.getXDifference(),distance.getYDifference(),distance.getZDifference())) if(backend.checkLongReachBlock(player,distance.getXDifference(),distance.getYDifference(),distance.getZDifference()))
{ {
event.setCancelled(true); event.setCancelled(true);
log("tried to break a block of "+block.getType().name()+" that was too far away.",player,CheckType.LONG_REACH); log("tried to break a block of "+block.getType().name()+" that was too far away.",player,CheckType.LONG_REACH);
@@ -18,8 +18,11 @@
package net.h31ix.anticheat.event; package net.h31ix.anticheat.event;
import net.h31ix.anticheat.manage.Backend;
import net.h31ix.anticheat.manage.CheckManager;
import net.h31ix.anticheat.manage.CheckType;
import net.h31ix.anticheat.manage.Distance;
import net.h31ix.anticheat.util.Utilities; import net.h31ix.anticheat.util.Utilities;
import net.h31ix.anticheat.manage.*;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
@@ -123,8 +126,8 @@ public class PlayerListener extends EventListener
} }
if(event.getClickedBlock() != null) if(event.getClickedBlock() != null)
{ {
Distance distance = new Distance(event.getPlayer().getLocation(), event.getClickedBlock().getLocation()); Distance distance = new Distance(player.getLocation(), event.getClickedBlock().getLocation());
backend.checkLongReachBlock(distance.getXDifference(), distance.getYDifference(), distance.getZDifference()); backend.checkLongReachBlock(player,distance.getXDifference(), distance.getYDifference(), distance.getZDifference());
} }
} }
@@ -140,9 +140,9 @@ public class Backend
micromanage = instance; micromanage = instance;
} }
public boolean checkLongReachBlock(double x,double y,double z) public boolean checkLongReachBlock(Player player,double x,double y,double z)
{ {
return x >= BLOCK_MAX_DISTANCE || y > BLOCK_MAX_DISTANCE || z > BLOCK_MAX_DISTANCE; return !Utilities.isUsingMcMMOAbility(player) && (x >= BLOCK_MAX_DISTANCE || y > BLOCK_MAX_DISTANCE || z > BLOCK_MAX_DISTANCE);
} }
public boolean checkLongReachDamage(double x,double y,double z) public boolean checkLongReachDamage(double x,double y,double z)
@@ -98,7 +98,7 @@ public final class Utilities
boolean b = false; boolean b = false;
if(player.getServer().getPluginManager().getPlugin("mcMMO") != null) if(player.getServer().getPluginManager().getPlugin("mcMMO") != null)
{ {
if(mcMMO.p.getPlayerProfile(player).getAbilityMode(AbilityType.TREE_FELLER) || mcMMO.p.getPlayerProfile(player).getAbilityMode(AbilityType.SUPER_BREAKER)) if(mcMMO.p.getPlayerProfile(player).getAbilityMode(AbilityType.TREE_FELLER) || mcMMO.p.getPlayerProfile(player).getAbilityMode(AbilityType.SUPER_BREAKER) || mcMMO.p.getPlayerProfile(player).getAbilityMode(AbilityType.BERSERK))
{ {
b = true; b = true;
} }
+1 -1
View File
@@ -6,7 +6,7 @@ name: AntiCheat
softdepend: [AntiCheat] softdepend: [AntiCheat]
startup: postworld startup: postworld
url: http://H31IX.NET/ url: http://H31IX.NET/
version: '1.1' version: '1.2'
commands: commands:
anticheat: anticheat:
description: Control and view info about AntiCheat description: Control and view info about AntiCheat