mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-02 14:38:45 +00:00
Added tools check for Fastbreak (Experimental), Revised block event listener, Decreased INSTANT_BREAK_TIME to 2 (5 seconds is too long to keep a player exempt from fastbreak & noswing).
This commit is contained in:
1 parent
164a1389f8
commit
0cbe96c748
6 files changed
+257
-68
No files matched your search
@@ -0,0 +1,35 @@
|
||||
package net.h31ix.anticheat.util;
|
||||
|
||||
import org.bukkit.Material;
|
||||
|
||||
public enum ToolHardness
|
||||
{
|
||||
|
||||
//NOTHING(null, 1.5)
|
||||
WOOD(0.75D),
|
||||
STONE(0.40D),
|
||||
IRON(0.25D),
|
||||
DIAMOND(0.20D),
|
||||
SHEARS(0.55D),
|
||||
GOLD(0.15D);
|
||||
|
||||
double hardness;
|
||||
|
||||
ToolHardness(double hard)
|
||||
{
|
||||
hardness = hard;
|
||||
}
|
||||
|
||||
public static double getToolHardness(Material tool)
|
||||
{
|
||||
for (ToolHardness e : ToolHardness.values())
|
||||
{
|
||||
if (tool.name().contains(e.name()))
|
||||
{
|
||||
return e.hardness;
|
||||
}
|
||||
}
|
||||
|
||||
return 1.50D;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user