mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-01 22:14:49 +00:00
Update reach distances
This commit is contained in:
1 parent
5f1ac209d4
commit
2e7b6a770a
4 files changed
+14
-29
No files matched your search
@@ -225,6 +225,7 @@ public class Backend {
|
||||
return new CheckResult(Result.PASSED);
|
||||
} else {
|
||||
String string = player.getName()+" reached too far for a block";
|
||||
System.out.println(x);
|
||||
double i = x >= magic.BLOCK_MAX_DISTANCE ? x : y > magic.BLOCK_MAX_DISTANCE ? y : z > magic.BLOCK_MAX_DISTANCE ? z : -1;
|
||||
if(i != -1) {
|
||||
return new CheckResult(Result.FAILED, string+" (distance="+i+", max="+magic.BLOCK_MAX_DISTANCE+")");
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
package net.h31ix.anticheat.test;
|
||||
|
||||
import net.h31ix.anticheat.util.BlockHardness;
|
||||
import org.bukkit.Material;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
public class BlockHardnessTest {
|
||||
|
||||
@Test
|
||||
public void verifyExistence() {
|
||||
for(Material m : Material.values()) {
|
||||
if(!BlockHardness.hasBlockHardness(m) && m.isBlock() && m != Material.AIR && m != Material.BEDROCK) {
|
||||
Assert.fail("Material " + m + " is not accounted for by BlockHardness");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void verifyName() {
|
||||
for(Material m : Material.values()) {
|
||||
BlockHardness hardness = BlockHardness.getHardness(m);
|
||||
if(hardness != null && !hardness.name().equals(m.name())) {
|
||||
Assert.fail("BlockHardness " + hardness + " and its material " + m + " have mismatched names");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -249,10 +249,18 @@ public class Magic {
|
||||
* Minimum distance a player can break a block from; Type=double, +Leniency=Increase.
|
||||
*/
|
||||
public final double BLOCK_MAX_DISTANCE;
|
||||
/**
|
||||
* Minimum distance a player can break a block from in creative mode; Type=double, +Leniency=Increase.
|
||||
*/
|
||||
public final double BLOCK_MAX_DISTANCE_CREATIVE;
|
||||
/**
|
||||
* Minimum distance a player can damage an entity from; Type=double, +Leniency=Increase.
|
||||
*/
|
||||
public final double ENTITY_MAX_DISTANCE;
|
||||
/**
|
||||
* Minimum distance a player can damage an entity from in creative mode; Type=double, +Leniency=Increase.
|
||||
*/
|
||||
public final double ENTITY_MAX_DISTANCE_CREATIVE;
|
||||
/**
|
||||
* Maximum speed a player on a ladder can travel; Type=double, +Leniency=Increase.
|
||||
*/
|
||||
@@ -398,7 +406,9 @@ public class Magic {
|
||||
EAT_TIME_MIN = getLong("EAT_TIME_MIN");
|
||||
BOW_ERROR = getDouble("BOW_ERROR");
|
||||
BLOCK_MAX_DISTANCE = getDouble("BLOCK_MAX_DISTANCE");
|
||||
BLOCK_MAX_DISTANCE_CREATIVE = getDouble("BLOCK_MAX_DISTANCE_CREATIVE");
|
||||
ENTITY_MAX_DISTANCE = getDouble("ENTITY_MAX_DISTANCE");
|
||||
ENTITY_MAX_DISTANCE_CREATIVE = getDouble("ENTITY_MAX_DISTANCE_CREATIVE");
|
||||
LADDER_Y_MAX = getDouble("LADDER_Y_MAX");
|
||||
LADDER_Y_MIN = getDouble("LADDER_Y_MIN");
|
||||
Y_SPEED_MAX = getDouble("Y_SPEED_MAX");
|
||||
|
||||
Reference in new issue
Block a user