mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-02 14:38:45 +00:00
Compare commits
16
Commits
1.9.4-PRE1
...
1.9.6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e5c8c5dc8a | ||
|
|
15c61fac67 | ||
|
|
7e1f0d83ce | ||
|
|
bd1db83a98 | ||
|
|
646e906ada | ||
|
|
9473781a26 | ||
|
|
6497891e43 | ||
|
|
0dc3a8053d | ||
|
|
1b5f2dcaa1 | ||
|
|
b232026644 | ||
|
|
0c91ec7ba4 | ||
|
|
abff433510 | ||
|
|
fad298086c | ||
|
|
8b413a382a | ||
|
|
1428b55591 | ||
|
|
a84b573fa8 |
No files matched your search
@@ -0,0 +1,12 @@
|
|||||||
|
# These are supported funding model platforms
|
||||||
|
|
||||||
|
github: [Rammelkast]
|
||||||
|
patreon: # Replace with a single Patreon username
|
||||||
|
open_collective: # Replace with a single Open Collective username
|
||||||
|
ko_fi: # Replace with a single Ko-fi username
|
||||||
|
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||||
|
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||||
|
liberapay: # Replace with a single Liberapay username
|
||||||
|
issuehunt: # Replace with a single IssueHunt username
|
||||||
|
otechie: # Replace with a single Otechie username
|
||||||
|
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>com.rammelkast.anticheatreloaded</groupId>
|
<groupId>com.rammelkast.anticheatreloaded</groupId>
|
||||||
<artifactId>AntiCheatReloaded</artifactId>
|
<artifactId>AntiCheatReloaded</artifactId>
|
||||||
<version>1.9.4-PRE</version>
|
<version>1.9.6</version>
|
||||||
<name>AntiCheatReloaded</name>
|
<name>AntiCheatReloaded</name>
|
||||||
<url>https://www.spigotmc.org/resources/anticheatreloaded.23799/</url>
|
<url>https://www.spigotmc.org/resources/anticheatreloaded.23799/</url>
|
||||||
<properties>
|
<properties>
|
||||||
@@ -69,6 +69,7 @@
|
|||||||
<groupId>com.comphenix.protocol</groupId>
|
<groupId>com.comphenix.protocol</groupId>
|
||||||
<artifactId>ProtocolLib</artifactId>
|
<artifactId>ProtocolLib</artifactId>
|
||||||
<version>4.6.0-SNAPSHOT</version>
|
<version>4.6.0-SNAPSHOT</version>
|
||||||
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.spigotmc</groupId>
|
<groupId>org.spigotmc</groupId>
|
||||||
@@ -79,7 +80,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.spigotmc</groupId>
|
<groupId>org.spigotmc</groupId>
|
||||||
<artifactId>spigot</artifactId>
|
<artifactId>spigot</artifactId>
|
||||||
<version>1.16.3-R0.1-SNAPSHOT</version>
|
<version>1.16.4-R0.1-SNAPSHOT</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|||||||
@@ -40,7 +40,6 @@ import com.rammelkast.anticheatreloaded.event.BlockListener;
|
|||||||
import com.rammelkast.anticheatreloaded.event.EntityListener;
|
import com.rammelkast.anticheatreloaded.event.EntityListener;
|
||||||
import com.rammelkast.anticheatreloaded.event.InventoryListener;
|
import com.rammelkast.anticheatreloaded.event.InventoryListener;
|
||||||
import com.rammelkast.anticheatreloaded.event.PlayerListener;
|
import com.rammelkast.anticheatreloaded.event.PlayerListener;
|
||||||
import com.rammelkast.anticheatreloaded.event.PotionEffectListener;
|
|
||||||
import com.rammelkast.anticheatreloaded.event.VehicleListener;
|
import com.rammelkast.anticheatreloaded.event.VehicleListener;
|
||||||
import com.rammelkast.anticheatreloaded.manage.AntiCheatManager;
|
import com.rammelkast.anticheatreloaded.manage.AntiCheatManager;
|
||||||
import com.rammelkast.anticheatreloaded.metrics.Metrics;
|
import com.rammelkast.anticheatreloaded.metrics.Metrics;
|
||||||
@@ -77,9 +76,6 @@ public class AntiCheatReloaded extends JavaPlugin {
|
|||||||
eventList.add(new EntityListener());
|
eventList.add(new EntityListener());
|
||||||
eventList.add(new VehicleListener());
|
eventList.add(new VehicleListener());
|
||||||
eventList.add(new InventoryListener());
|
eventList.add(new InventoryListener());
|
||||||
// Handles 1.9+ potion effects
|
|
||||||
if (!VersionUtil.isBountifulUpdate())
|
|
||||||
eventList.add(new PotionEffectListener());
|
|
||||||
// Order is important in some cases, don't screw with these unless
|
// Order is important in some cases, don't screw with these unless
|
||||||
// needed, especially config
|
// needed, especially config
|
||||||
this.setupConfig();
|
this.setupConfig();
|
||||||
|
|||||||
@@ -231,8 +231,11 @@ public class Backend {
|
|||||||
if (player.getGameMode() != GameMode.CREATIVE && !player.isInsideVehicle() && !player.isSleeping()
|
if (player.getGameMode() != GameMode.CREATIVE && !player.isInsideVehicle() && !player.isSleeping()
|
||||||
&& !isMovingExempt(player) && !justPlaced(player) && !Utilities.isNearWater(player)
|
&& !isMovingExempt(player) && !justPlaced(player) && !Utilities.isNearWater(player)
|
||||||
&& !Utilities.isInWeb(player) && !player.getLocation().getBlock().getType().name().endsWith("TRAPDOOR")
|
&& !Utilities.isInWeb(player) && !player.getLocation().getBlock().getType().name().endsWith("TRAPDOOR")
|
||||||
&& !VersionUtil.isSlowFalling(player) && !Utilities
|
&& !VersionUtil.isSlowFalling(player)
|
||||||
.isNearShulkerBox(player.getLocation().getBlock().getRelative(BlockFace.DOWN).getLocation()) && !Utilities.isNearClimbable(player)) {
|
&& !Utilities
|
||||||
|
.isNearShulkerBox(player.getLocation().getBlock().getRelative(BlockFace.DOWN).getLocation())
|
||||||
|
&& !Utilities.isNearClimbable(player)
|
||||||
|
&& !Utilities.isNearWater(player.getLocation().clone().subtract(0, 1.5, 0))) {
|
||||||
if (player.getFallDistance() == 0) {
|
if (player.getFallDistance() == 0) {
|
||||||
if (nofallViolation.get(uuid) == null) {
|
if (nofallViolation.get(uuid) == null) {
|
||||||
nofallViolation.put(uuid, 1);
|
nofallViolation.put(uuid, 1);
|
||||||
@@ -244,8 +247,8 @@ public class Backend {
|
|||||||
int vlBeforeFlag = checksConfig.getInteger(CheckType.NOFALL, "vlBeforeFlag");
|
int vlBeforeFlag = checksConfig.getInteger(CheckType.NOFALL, "vlBeforeFlag");
|
||||||
if (i >= vlBeforeFlag) {
|
if (i >= vlBeforeFlag) {
|
||||||
nofallViolation.put(player.getUniqueId(), 1);
|
nofallViolation.put(player.getUniqueId(), 1);
|
||||||
return new CheckResult(CheckResult.Result.FAILED, "tried to avoid fall damage (fall distance = 0 "
|
return new CheckResult(CheckResult.Result.FAILED,
|
||||||
+ i + " times in a row, max=" + vlBeforeFlag + ")");
|
"tried to avoid fall damage (" + i + " times in a row, max=" + vlBeforeFlag + ")");
|
||||||
} else {
|
} else {
|
||||||
return PASS;
|
return PASS;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,9 +71,11 @@ public class ElytraCheck {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!JUMP_Y_VALUE.containsKey(uuid)) {
|
if (!JUMP_Y_VALUE.containsKey(uuid)) {
|
||||||
JUMP_Y_VALUE.put(uuid, distance.toY());
|
// Distance + player height
|
||||||
|
JUMP_Y_VALUE.put(uuid, distance.toY() + 1.8D);
|
||||||
return PASS;
|
return PASS;
|
||||||
}
|
}
|
||||||
|
|
||||||
double lastY = JUMP_Y_VALUE.get(uuid);
|
double lastY = JUMP_Y_VALUE.get(uuid);
|
||||||
if (lastY < distance.toY()) {
|
if (lastY < distance.toY()) {
|
||||||
double diff = distance.toY() - lastY;
|
double diff = distance.toY() - lastY;
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.rammelkast.anticheatreloaded.check.movement;
|
package com.rammelkast.anticheatreloaded.check.movement;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@@ -31,6 +30,7 @@ import com.rammelkast.anticheatreloaded.check.CheckResult.Result;
|
|||||||
import com.rammelkast.anticheatreloaded.check.CheckType;
|
import com.rammelkast.anticheatreloaded.check.CheckType;
|
||||||
import com.rammelkast.anticheatreloaded.config.providers.Checks;
|
import com.rammelkast.anticheatreloaded.config.providers.Checks;
|
||||||
import com.rammelkast.anticheatreloaded.util.Utilities;
|
import com.rammelkast.anticheatreloaded.util.Utilities;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.VersionUtil;
|
||||||
|
|
||||||
public class FastLadderCheck {
|
public class FastLadderCheck {
|
||||||
|
|
||||||
@@ -38,11 +38,11 @@ public class FastLadderCheck {
|
|||||||
private static final CheckResult PASS = new CheckResult(CheckResult.Result.PASSED);
|
private static final CheckResult PASS = new CheckResult(CheckResult.Result.PASSED);
|
||||||
|
|
||||||
public static CheckResult runCheck(Player player, double y) {
|
public static CheckResult runCheck(Player player, double y) {
|
||||||
// Only check if fully on ladder
|
// Only check if fully on ladder and not flying
|
||||||
// Liquids are climbable blocks, so we have to add a seperate check
|
// Liquids are climbable blocks, so we have to add a seperate check
|
||||||
if (!Utilities.isClimbableBlock(player.getLocation().getBlock())
|
if (!Utilities.isClimbableBlock(player.getLocation().getBlock())
|
||||||
|| !Utilities.isClimbableBlock(player.getEyeLocation().getBlock())
|
|| !Utilities.isClimbableBlock(player.getEyeLocation().getBlock())
|
||||||
|| player.getLocation().getBlock().isLiquid()) {
|
|| player.getLocation().getBlock().isLiquid() || VersionUtil.isFlying(player)) {
|
||||||
return PASS;
|
return PASS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import java.util.HashMap;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.BlockFace;
|
import org.bukkit.block.BlockFace;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.potion.PotionEffectType;
|
import org.bukkit.potion.PotionEffectType;
|
||||||
@@ -62,7 +63,8 @@ public class FlightCheck {
|
|||||||
Backend backend = AntiCheatReloaded.getManager().getBackend();
|
Backend backend = AntiCheatReloaded.getManager().getBackend();
|
||||||
Checks checksConfig = AntiCheatReloaded.getManager().getConfiguration().getChecks();
|
Checks checksConfig = AntiCheatReloaded.getManager().getConfiguration().getChecks();
|
||||||
|
|
||||||
if (movementManager.nearLiquidTicks > 0 || movementManager.halfMovement || Utilities.isNearClimbable(player))
|
if (movementManager.nearLiquidTicks > 0 || movementManager.halfMovement || Utilities.isNearClimbable(player)
|
||||||
|
|| movementManager.riptideTicks > 0)
|
||||||
return PASS;
|
return PASS;
|
||||||
|
|
||||||
int minAirTicks = 13;
|
int minAirTicks = 13;
|
||||||
@@ -91,18 +93,27 @@ public class FlightCheck {
|
|||||||
// Fixes snow false positive
|
// Fixes snow false positive
|
||||||
if (movementManager.motionY < 0.004 && Utilities
|
if (movementManager.motionY < 0.004 && Utilities
|
||||||
.isNearHalfblock(distance.getFrom().getBlock().getRelative(BlockFace.DOWN).getLocation()))
|
.isNearHalfblock(distance.getFrom().getBlock().getRelative(BlockFace.DOWN).getLocation()))
|
||||||
maxMotionY = 0.004D;
|
maxMotionY += 0.004D;
|
||||||
|
if (Utilities.isNearWater(player) || Utilities.isNearWater(distance.getFrom().clone().subtract(0, 0.51, 0)))
|
||||||
|
maxMotionY += 0.05;
|
||||||
if (movementManager.motionY > maxMotionY && movementManager.slimeInfluenceTicks <= 0
|
if (movementManager.motionY > maxMotionY && movementManager.slimeInfluenceTicks <= 0
|
||||||
&& !Utilities.isNearClimbable(distance.getTo().clone().subtract(0, 1.25, 0)))
|
&& !Utilities.isNearClimbable(distance.getTo().clone().subtract(0, 1.25, 0))
|
||||||
|
&& !Utilities.isNearClimbable(distance.getTo().clone().subtract(0, 0.75, 0))
|
||||||
|
&& (!Utilities.isNearWater(distance.getTo().clone().subtract(0, 1.5, 0))
|
||||||
|
&& distance.getTo().clone().subtract(0, 0.5, 0).getBlock().getType() != Material.AIR))
|
||||||
return new CheckResult(CheckResult.Result.FAILED, "AirFlight",
|
return new CheckResult(CheckResult.Result.FAILED, "AirFlight",
|
||||||
"tried to fly on the Y-axis (mY=" + movementManager.motionY + ", max=" + maxMotionY + ")");
|
"tried to fly on the Y-axis (mY=" + movementManager.motionY + ", max=" + maxMotionY + ")");
|
||||||
|
|
||||||
if (Math.abs(movementManager.motionY - movementManager.lastMotionY) < 0.01
|
if (Math.abs(movementManager.motionY
|
||||||
|
- movementManager.lastMotionY) < (movementManager.airTicks >= 115 ? 1E-3 : 5E-3)
|
||||||
&& !Utilities.couldBeOnBoat(player)
|
&& !Utilities.couldBeOnBoat(player)
|
||||||
&& (System.currentTimeMillis() - movementManager.lastTeleport >= checksConfig
|
&& (System.currentTimeMillis() - movementManager.lastTeleport >= checksConfig
|
||||||
.getInteger(CheckType.FLIGHT, "airFlight", "accountForTeleports"))
|
.getInteger(CheckType.FLIGHT, "airFlight", "accountForTeleports"))
|
||||||
&& !VersionUtil.isSlowFalling(player) && !Utilities.isNearWeb(player)
|
&& !VersionUtil.isSlowFalling(player) && !Utilities.isNearWeb(player)
|
||||||
&& movementManager.elytraEffectTicks <= 25)
|
&& movementManager.elytraEffectTicks <= 25
|
||||||
|
&& !Utilities.isNearClimbable(distance.getFrom().clone().subtract(0, 0.51D, 0))
|
||||||
|
&& !Utilities.isNearWater(player)
|
||||||
|
&& !Utilities.isNearWater(distance.getFrom().clone().subtract(0, 0.51, 0)))
|
||||||
return new CheckResult(CheckResult.Result.FAILED, "AirFlight", "had too little Y dropoff (diff="
|
return new CheckResult(CheckResult.Result.FAILED, "AirFlight", "had too little Y dropoff (diff="
|
||||||
+ Math.abs(movementManager.motionY - movementManager.lastMotionY) + ")");
|
+ Math.abs(movementManager.motionY - movementManager.lastMotionY) + ")");
|
||||||
}
|
}
|
||||||
@@ -121,8 +132,9 @@ public class FlightCheck {
|
|||||||
&& !player.hasPotionEffect(PotionEffectType.JUMP)
|
&& !player.hasPotionEffect(PotionEffectType.JUMP)
|
||||||
&& (System.currentTimeMillis() - movementManager.lastTeleport >= checksConfig
|
&& (System.currentTimeMillis() - movementManager.lastTeleport >= checksConfig
|
||||||
.getInteger(CheckType.FLIGHT, "airClimb", "accountForTeleports"))
|
.getInteger(CheckType.FLIGHT, "airClimb", "accountForTeleports"))
|
||||||
&& (!Utilities.isNearBed(distance.getTo())
|
&& (!Utilities.isNearBed(distance.getTo()) || ((Utilities.isNearBed(distance.getTo())
|
||||||
|| (Utilities.isNearBed(distance.getTo()) && movementManager.motionY > 0.12675))
|
|| Utilities.isNearBed(distance.getTo().clone().add(0, -0.51, 0)))
|
||||||
|
&& movementManager.motionY > 0.15))
|
||||||
&& movementManager.slimeInfluenceTicks == 0 && movementManager.elytraEffectTicks <= 25)
|
&& movementManager.slimeInfluenceTicks == 0 && movementManager.elytraEffectTicks <= 25)
|
||||||
return new CheckResult(CheckResult.Result.FAILED, "AirClimb",
|
return new CheckResult(CheckResult.Result.FAILED, "AirClimb",
|
||||||
"tried to climb air (mY=" + movementManager.motionY + ")");
|
"tried to climb air (mY=" + movementManager.motionY + ")");
|
||||||
@@ -160,13 +172,20 @@ public class FlightCheck {
|
|||||||
double gravitatedY = (movementManager.lastMotionY - 0.08) * GRAVITY_FRICTION;
|
double gravitatedY = (movementManager.lastMotionY - 0.08) * GRAVITY_FRICTION;
|
||||||
double offset = Math.abs(gravitatedY - movementManager.motionY);
|
double offset = Math.abs(gravitatedY - movementManager.motionY);
|
||||||
double maxOffset = checksConfig.getDouble(CheckType.FLIGHT, "gravity", "maxOffset");
|
double maxOffset = checksConfig.getDouble(CheckType.FLIGHT, "gravity", "maxOffset");
|
||||||
|
if (Utilities.isNearClimbable(distance.getFrom().clone().subtract(0, 0.51D, 0))
|
||||||
|
|| Utilities.isNearClimbable(distance.getFrom()) || Utilities.isNearWater(player)
|
||||||
|
|| (!Utilities.isNearWater(distance.getTo().clone().subtract(0, 1.5, 0))
|
||||||
|
&& distance.getTo().clone().subtract(0, 0.5, 0).getBlock().getType() != Material.AIR))
|
||||||
|
maxOffset += 0.15D;
|
||||||
if (offset > maxOffset && movementManager.airTicks > 2) {
|
if (offset > maxOffset && movementManager.airTicks > 2) {
|
||||||
int vl = GRAVITY_VIOLATIONS.getOrDefault(player.getUniqueId(), 0) + 1;
|
int vl = GRAVITY_VIOLATIONS.getOrDefault(player.getUniqueId(), 0) + 1;
|
||||||
GRAVITY_VIOLATIONS.put(player.getUniqueId(), vl);
|
GRAVITY_VIOLATIONS.put(player.getUniqueId(), vl);
|
||||||
int vlBeforeFlag = checksConfig.getInteger(CheckType.FLIGHT, "gravity", "vlBeforeFlag");
|
int vlBeforeFlag = checksConfig.getInteger(CheckType.FLIGHT, "gravity", "vlBeforeFlag");
|
||||||
if (vl >= vlBeforeFlag)
|
if (vl >= vlBeforeFlag) {
|
||||||
|
GRAVITY_VIOLATIONS.put(player.getUniqueId(), Math.max(0, vl - 2));
|
||||||
return new CheckResult(CheckResult.Result.FAILED, "Gravity",
|
return new CheckResult(CheckResult.Result.FAILED, "Gravity",
|
||||||
"ignored gravity (offset=" + offset + ", at=" + movementManager.airTicks + ")");
|
"ignored gravity (offset=" + offset + ", at=" + movementManager.airTicks + ")");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
GRAVITY_VIOLATIONS.remove(player.getUniqueId());
|
GRAVITY_VIOLATIONS.remove(player.getUniqueId());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ import com.rammelkast.anticheatreloaded.util.Utilities;
|
|||||||
import com.rammelkast.anticheatreloaded.util.VersionUtil;
|
import com.rammelkast.anticheatreloaded.util.VersionUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Rammelkast TODO soulsand speed
|
* @author Rammelkast TODO soulsand speed TODO buffer system
|
||||||
*/
|
*/
|
||||||
public class SpeedCheck {
|
public class SpeedCheck {
|
||||||
|
|
||||||
@@ -51,6 +51,9 @@ public class SpeedCheck {
|
|||||||
|
|
||||||
MovementManager movementManager = AntiCheatReloaded.getManager().getUserManager().getUser(player.getUniqueId())
|
MovementManager movementManager = AntiCheatReloaded.getManager().getUserManager().getUser(player.getUniqueId())
|
||||||
.getMovementManager();
|
.getMovementManager();
|
||||||
|
// Riptiding exemption
|
||||||
|
if (movementManager.riptideTicks > 0)
|
||||||
|
return PASS;
|
||||||
Checks checksConfig = AntiCheatReloaded.getManager().getConfiguration().getChecks();
|
Checks checksConfig = AntiCheatReloaded.getManager().getConfiguration().getChecks();
|
||||||
double distanceXZ = movementManager.distanceXZ;
|
double distanceXZ = movementManager.distanceXZ;
|
||||||
boolean boxedIn = movementManager.topSolid && movementManager.bottomSolid;
|
boolean boxedIn = movementManager.topSolid && movementManager.bottomSolid;
|
||||||
@@ -60,6 +63,9 @@ public class SpeedCheck {
|
|||||||
&& movementManager.elytraEffectTicks <= 0 && !Utilities.isNearClimbable(player)) {
|
&& movementManager.elytraEffectTicks <= 0 && !Utilities.isNearClimbable(player)) {
|
||||||
double multiplier = 0.985D;
|
double multiplier = 0.985D;
|
||||||
double predict = 0.36 * Math.pow(multiplier, movementManager.airTicks + 1);
|
double predict = 0.36 * Math.pow(multiplier, movementManager.airTicks + 1);
|
||||||
|
// Prevents false when falling from great heights
|
||||||
|
if (movementManager.airTicks >= 115)
|
||||||
|
predict = Math.max(0.08, predict);
|
||||||
double limit = checksConfig.getDouble(CheckType.SPEED, "airSpeed", "baseLimit"); // Default 0.03125
|
double limit = checksConfig.getDouble(CheckType.SPEED, "airSpeed", "baseLimit"); // Default 0.03125
|
||||||
// Adjust for ice
|
// Adjust for ice
|
||||||
if (movementManager.iceInfluenceTicks > 0) {
|
if (movementManager.iceInfluenceTicks > 0) {
|
||||||
@@ -115,7 +121,7 @@ public class SpeedCheck {
|
|||||||
if (VersionUtil.isSlowFalling(player))
|
if (VersionUtil.isSlowFalling(player))
|
||||||
predict *= 1.25D;
|
predict *= 1.25D;
|
||||||
// Prevent NoSlow
|
// Prevent NoSlow
|
||||||
if (movementManager.blockingTicks > 2 && movementManager.airTicks > 2)
|
if (movementManager.blockingTicks > 3 && movementManager.airTicks > 2)
|
||||||
predict *= 0.8D;
|
predict *= 0.8D;
|
||||||
if (movementManager.blockingTicks > 10 && movementManager.airTicks > 2)
|
if (movementManager.blockingTicks > 10 && movementManager.airTicks > 2)
|
||||||
predict *= 0.5D;
|
predict *= 0.5D;
|
||||||
@@ -141,13 +147,13 @@ public class SpeedCheck {
|
|||||||
double limit = checksConfig.getDouble(CheckType.SPEED, "airAcceleration", "baseLimit"); // Default 0.3725
|
double limit = checksConfig.getDouble(CheckType.SPEED, "airAcceleration", "baseLimit"); // Default 0.3725
|
||||||
// Slight increase when boxed in
|
// Slight increase when boxed in
|
||||||
if (boxedIn)
|
if (boxedIn)
|
||||||
limit *= 1.05D;
|
limit *= 1.08D;
|
||||||
// Adjust for speed effects
|
// Adjust for speed effects
|
||||||
if (player.hasPotionEffect(PotionEffectType.SPEED))
|
if (player.hasPotionEffect(PotionEffectType.SPEED))
|
||||||
limit += VersionUtil.getPotionLevel(player, PotionEffectType.SPEED) * 0.0225D;
|
limit += VersionUtil.getPotionLevel(player, PotionEffectType.SPEED) * 0.0225D;
|
||||||
// Adjust for slabs
|
// Adjust for slabs
|
||||||
if (movementManager.halfMovementHistoryCounter > 15)
|
if (movementManager.halfMovementHistoryCounter > 15)
|
||||||
limit *= 2.0D;
|
limit *= 2.05D;
|
||||||
// Adjust for custom walking speed
|
// Adjust for custom walking speed
|
||||||
double walkSpeedMultiplier = checksConfig.getDouble(CheckType.SPEED, "airAcceleration",
|
double walkSpeedMultiplier = checksConfig.getDouble(CheckType.SPEED, "airAcceleration",
|
||||||
"walkSpeedMultiplier"); // Default 1.4
|
"walkSpeedMultiplier"); // Default 1.4
|
||||||
@@ -164,14 +170,16 @@ public class SpeedCheck {
|
|||||||
// JumpBehaviour
|
// JumpBehaviour
|
||||||
// Works against YPorts and mini jumps
|
// Works against YPorts and mini jumps
|
||||||
if (checksConfig.isSubcheckEnabled(CheckType.SPEED, "jumpBehaviour") && movementManager.touchedGroundThisTick
|
if (checksConfig.isSubcheckEnabled(CheckType.SPEED, "jumpBehaviour") && movementManager.touchedGroundThisTick
|
||||||
&& !boxedIn && movementManager.slimeInfluenceTicks <= 10) {
|
&& !boxedIn && movementManager.slimeInfluenceTicks <= 10 && !Utilities.isNearHalfblock(movingTowards)
|
||||||
|
&& !Utilities.isNearHalfblock(movingTowards.clone().subtract(0, 0.51, 0))) {
|
||||||
// This happens naturally
|
// This happens naturally
|
||||||
if (movementManager.airTicksBeforeGrounded == movementManager.groundTicks) {
|
if (movementManager.airTicksBeforeGrounded == movementManager.groundTicks) {
|
||||||
double minimumDistXZ = checksConfig.getDouble(CheckType.SPEED, "jumpBehaviour", "minimumDistXZ"); // Default
|
double minimumDistXZ = checksConfig.getDouble(CheckType.SPEED, "jumpBehaviour", "minimumDistXZ"); // Default
|
||||||
// 0.42
|
|
||||||
if (distanceXZ >= minimumDistXZ) {
|
if (distanceXZ >= minimumDistXZ || movementManager.lastDistanceXZ >= minimumDistXZ) {
|
||||||
return new CheckResult(CheckResult.Result.FAILED, "JumpBehaviour",
|
return new CheckResult(CheckResult.Result.FAILED, "JumpBehaviour",
|
||||||
"had unexpected jumping behaviour");
|
"had unexpected jumping behaviour (dXZ=" + Utilities.roundDouble(distanceXZ, 4) + ", lXZ="
|
||||||
|
+ Utilities.roundDouble(movementManager.lastDistanceXZ, 4) + ")");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -200,6 +208,11 @@ public class SpeedCheck {
|
|||||||
limit *= 1.4D;
|
limit *= 1.4D;
|
||||||
if (movementManager.hadSpeedEffect && !movementManager.hasSpeedEffect)
|
if (movementManager.hadSpeedEffect && !movementManager.hasSpeedEffect)
|
||||||
limit *= 1.2D;
|
limit *= 1.2D;
|
||||||
|
// Other speed increasing effects (idk why, bloody Bukkt..)
|
||||||
|
if (movementManager.hasIncreasingEffect && movementManager.groundTicks > 3)
|
||||||
|
limit *= 1.12D;
|
||||||
|
if (movementManager.hadIncreasingEffect && !movementManager.hasIncreasingEffect)
|
||||||
|
limit *= 1.08D;
|
||||||
if (movementManager.iceInfluenceTicks >= 50) {
|
if (movementManager.iceInfluenceTicks >= 50) {
|
||||||
// When moving off ice
|
// When moving off ice
|
||||||
if (!Utilities.couldBeOnIce(movingTowards))
|
if (!Utilities.couldBeOnIce(movingTowards))
|
||||||
@@ -246,10 +259,13 @@ public class SpeedCheck {
|
|||||||
public static CheckResult checkVerticalSpeed(Player player, Distance distance) {
|
public static CheckResult checkVerticalSpeed(Player player, Distance distance) {
|
||||||
Backend backend = AntiCheatReloaded.getManager().getBackend();
|
Backend backend = AntiCheatReloaded.getManager().getBackend();
|
||||||
if (isSpeedExempt(player, backend) || player.getVehicle() != null || player.isSleeping()
|
if (isSpeedExempt(player, backend) || player.getVehicle() != null || player.isSleeping()
|
||||||
|| VersionUtil.isRiptiding(player) || Utilities.isNearWater(player))
|
|| Utilities.isNearWater(player))
|
||||||
return PASS;
|
return PASS;
|
||||||
MovementManager movementManager = AntiCheatReloaded.getManager().getUserManager().getUser(player.getUniqueId())
|
MovementManager movementManager = AntiCheatReloaded.getManager().getUserManager().getUser(player.getUniqueId())
|
||||||
.getMovementManager();
|
.getMovementManager();
|
||||||
|
// Riptiding exemption
|
||||||
|
if (movementManager.riptideTicks > 0)
|
||||||
|
return PASS;
|
||||||
Checks checksConfig = AntiCheatReloaded.getManager().getConfiguration().getChecks();
|
Checks checksConfig = AntiCheatReloaded.getManager().getConfiguration().getChecks();
|
||||||
if (!checksConfig.isSubcheckEnabled(CheckType.SPEED, "verticalSpeed"))
|
if (!checksConfig.isSubcheckEnabled(CheckType.SPEED, "verticalSpeed"))
|
||||||
return PASS;
|
return PASS;
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ public class StrafeCheck {
|
|||||||
public static CheckResult runCheck(Player player, double x, double z, Location from, Location to) {
|
public static CheckResult runCheck(Player player, double x, double z, Location from, Location to) {
|
||||||
if (!Utilities.cantStandAtExp(from) || !Utilities.cantStandAtExp(to) || Utilities.isNearWater(player)
|
if (!Utilities.cantStandAtExp(from) || !Utilities.cantStandAtExp(to) || Utilities.isNearWater(player)
|
||||||
|| Utilities.isNearClimbable(player) || VersionUtil.isFlying(player) || player.isDead()
|
|| Utilities.isNearClimbable(player) || VersionUtil.isFlying(player) || player.isDead()
|
||||||
|| Utilities.isHalfblock(to.getBlock().getRelative(BlockFace.DOWN)))
|
|| Utilities.isHalfblock(to.getBlock().getRelative(BlockFace.DOWN)) || Utilities.isNearHalfblock(to))
|
||||||
return PASS;
|
return PASS;
|
||||||
|
|
||||||
MovementManager movementManager = AntiCheatReloaded.getManager().getUserManager().getUser(player.getUniqueId())
|
MovementManager movementManager = AntiCheatReloaded.getManager().getUserManager().getUser(player.getUniqueId())
|
||||||
|
|||||||
@@ -44,9 +44,10 @@ public class WaterWalkCheck {
|
|||||||
MovementManager movementManager = user.getMovementManager();
|
MovementManager movementManager = user.getMovementManager();
|
||||||
|
|
||||||
if (movementManager.distanceXZ <= 0 || player.getVehicle() != null || Utilities.isOnLilyPad(player)
|
if (movementManager.distanceXZ <= 0 || player.getVehicle() != null || Utilities.isOnLilyPad(player)
|
||||||
|| VersionUtil.isRiptiding(player) || VersionUtil.isSwimming(player) || VersionUtil.isFlying(player))
|
|| movementManager.riptideTicks > 0 || VersionUtil.isSwimming(player) || VersionUtil.isFlying(player)
|
||||||
|
|| player.getLocation().getBlock().getType().name().endsWith("CARPET"))
|
||||||
return PASS;
|
return PASS;
|
||||||
|
|
||||||
Checks checksConfig = AntiCheatReloaded.getManager().getConfiguration().getChecks();
|
Checks checksConfig = AntiCheatReloaded.getManager().getConfiguration().getChecks();
|
||||||
Block blockBeneath = player.getLocation().clone().subtract(0, 0.1, 0).getBlock();
|
Block blockBeneath = player.getLocation().clone().subtract(0, 0.1, 0).getBlock();
|
||||||
if (checksConfig.isSubcheckEnabled(CheckType.WATER_WALK, "walk") && blockBeneath.isLiquid()
|
if (checksConfig.isSubcheckEnabled(CheckType.WATER_WALK, "walk") && blockBeneath.isLiquid()
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ public class IllegalInteract {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static CheckResult checkBlockPlace(Player player, BlockPlaceEvent event) {
|
private static CheckResult checkBlockPlace(Player player, BlockPlaceEvent event) {
|
||||||
if (!isValidTarget(player, event.getBlock())) {
|
if (event.getBlock().getType().isSolid() && !isValidTarget(player, event.getBlock())) {
|
||||||
return new CheckResult(CheckResult.Result.FAILED, "Place", "tried to place a block out of their view");
|
return new CheckResult(CheckResult.Result.FAILED, "Place", "tried to place a block out of their view");
|
||||||
}
|
}
|
||||||
return PASS;
|
return PASS;
|
||||||
|
|||||||
+144
-140
@@ -16,7 +16,6 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.rammelkast.anticheatreloaded.command.executors;
|
package com.rammelkast.anticheatreloaded.command.executors;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -25,8 +24,8 @@ import java.util.UUID;
|
|||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
import org.bukkit.OfflinePlayer;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
import com.rammelkast.anticheatreloaded.check.CheckType;
|
import com.rammelkast.anticheatreloaded.check.CheckType;
|
||||||
@@ -38,153 +37,158 @@ import com.rammelkast.anticheatreloaded.util.Utilities;
|
|||||||
|
|
||||||
public class CommandReport extends CommandBase {
|
public class CommandReport extends CommandBase {
|
||||||
|
|
||||||
private static final String NAME = "AntiCheatReloaded Reports";
|
private static final String NAME = "AntiCheatReloaded Reports";
|
||||||
private static final String COMMAND = "report";
|
private static final String COMMAND = "report";
|
||||||
private static final String USAGE = "anticheat report [group/user]";
|
private static final String USAGE = "anticheat report [group/user]";
|
||||||
private static final Permission PERMISSION = Permission.SYSTEM_REPORT;
|
private static final Permission PERMISSION = Permission.SYSTEM_REPORT;
|
||||||
private static final String[] HELP = {
|
private static final String[] HELP = {
|
||||||
GRAY + "Use: " + GOLD + "/anticheat report [group]" + GRAY + " to see all users in a given group",
|
GRAY + "Use: " + GOLD + "/anticheat report [group]" + GRAY + " to see all users in a given group",
|
||||||
GRAY + "Use: " + GOLD + "/anticheat report [user]" + GRAY + " to see a single user's report",
|
GRAY + "Use: " + GOLD + "/anticheat report [user]" + GRAY + " to see a single user's report",
|
||||||
GRAY + "Use: " + GOLD + "/anticheat report [user/group] [num]" + GRAY + " to see pages of a report",
|
GRAY + "Use: " + GOLD + "/anticheat report [user/group] [num]" + GRAY + " to see pages of a report", };
|
||||||
};
|
|
||||||
|
|
||||||
public CommandReport() {
|
public CommandReport() {
|
||||||
super(NAME, COMMAND, USAGE, HELP, PERMISSION);
|
super(NAME, COMMAND, USAGE, HELP, PERMISSION);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void execute(CommandSender cs, String[] args) {
|
protected void execute(CommandSender cs, String[] args) {
|
||||||
if (args.length >= 1) {
|
if (args.length >= 1) {
|
||||||
int page = 1;
|
int page = 1;
|
||||||
if (args.length == 2) {
|
if (args.length == 2) {
|
||||||
if (Utilities.isInt(args[1])) {
|
if (Utilities.isInt(args[1])) {
|
||||||
page = Integer.parseInt(args[1]);
|
page = Integer.parseInt(args[1]);
|
||||||
} else {
|
} else {
|
||||||
cs.sendMessage(RED + "Not a valid page number: " + WHITE + args[1]);
|
cs.sendMessage(RED + "Not a valid page number: " + WHITE + args[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("low".equalsIgnoreCase(args[0])) {
|
if ("low".equalsIgnoreCase(args[0])) {
|
||||||
groupReport(cs, null, page);
|
groupReport(cs, null, page);
|
||||||
}
|
} else if ("all".equalsIgnoreCase(args[0])) {
|
||||||
else if ("all".equalsIgnoreCase(args[0])) {
|
cs.sendMessage(GREEN + "Low: " + WHITE + USER_MANAGER.getUsersInGroup(null).size() + " players");
|
||||||
cs.sendMessage(GREEN + "Low: " + WHITE + USER_MANAGER.getUsersInGroup(null).size() + " players");
|
for (Group g : CONFIG.getGroups().getGroups()) {
|
||||||
for (Group g : CONFIG.getGroups().getGroups()) {
|
int numPlayers = USER_MANAGER.getUsersInGroup(g).size();
|
||||||
int numPlayers = USER_MANAGER.getUsersInGroup(g).size();
|
cs.sendMessage(g.getColor() + g.getName() + WHITE + ": " + numPlayers + " players");
|
||||||
cs.sendMessage(g.getColor() + g.getName() + WHITE + ": " + numPlayers + " players");
|
}
|
||||||
}
|
cs.sendMessage(GRAY + "Use " + GOLD + "/anticheat report [group]" + GRAY
|
||||||
cs.sendMessage(GRAY + "Use " + GOLD + "/anticheat report [group]" + GRAY + " for a list of players in each group.");
|
+ " for a list of players in each group.");
|
||||||
} else {
|
} else {
|
||||||
// Test groups
|
// Test groups
|
||||||
for (Group group : CONFIG.getGroups().getGroups()) {
|
for (Group group : CONFIG.getGroups().getGroups()) {
|
||||||
if (group.getName().equalsIgnoreCase(args[0]) || "low".equalsIgnoreCase(args[0]) || "all".equalsIgnoreCase(args[0])) {
|
if (group.getName().equalsIgnoreCase(args[0]) || "low".equalsIgnoreCase(args[0])
|
||||||
groupReport(cs, group, page);
|
|| "all".equalsIgnoreCase(args[0])) {
|
||||||
return;
|
groupReport(cs, group, page);
|
||||||
}
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Player targetPlayer = Bukkit.getPlayer(args[0]);
|
|
||||||
if (targetPlayer == null) {
|
|
||||||
cs.sendMessage(RED + "Not a valid group or user: " + WHITE + args[0]);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Test users
|
@SuppressWarnings("deprecation")
|
||||||
for (Player player : Bukkit.getOnlinePlayers()) {
|
OfflinePlayer targetPlayer = Bukkit.getOfflinePlayer(args[0]);
|
||||||
if (player.getUniqueId().equals(Bukkit.getPlayer(args[0]).getUniqueId())) {
|
if (targetPlayer == null) {
|
||||||
User user = AntiCheatReloaded.getManager().getUserManager().getUser(player.getUniqueId());
|
cs.sendMessage(RED + "Not a valid group or user: " + WHITE + args[0]);
|
||||||
playerReport(cs, user, page);
|
return;
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Neither of these
|
User user = AntiCheatReloaded.getManager().getUserManager().getUser(targetPlayer.getUniqueId());
|
||||||
cs.sendMessage(RED + "Not a valid group or user: " + WHITE + args[0]);
|
if (user != null) {
|
||||||
}
|
playerReport(cs, user, page);
|
||||||
} else {
|
return;
|
||||||
sendHelp(cs);
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void groupReport(CommandSender cs, Group group, int page) {
|
cs.sendMessage(RED + "Not a valid group or user: " + WHITE + args[0]);
|
||||||
List<User> users = USER_MANAGER.getUsersInGroup(group);
|
}
|
||||||
ChatColor color = group == null ? GREEN : group.getColor();
|
} else {
|
||||||
String groupName = group == null ? "Low" : group.getName();
|
sendHelp(cs);
|
||||||
int pages = (int) Math.ceil(((float) users.size()) / 7);
|
}
|
||||||
if (page <= pages && page > 0) {
|
}
|
||||||
cs.sendMessage(GOLD + "----------------------[" + GRAY + "Page " + page + "/" + pages + "" + GOLD + "]----------------------");
|
|
||||||
cs.sendMessage(GRAY + "Group: " + color + groupName);
|
|
||||||
for (int x = 0; x < 7; x++) {
|
|
||||||
int index = ((page - 1) * 6) + (x + ((page - 1) * 1));
|
|
||||||
if (index < users.size()) {
|
|
||||||
String player = users.get(index).getName();
|
|
||||||
cs.sendMessage(GRAY + player);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cs.sendMessage(MENU_END);
|
|
||||||
} else {
|
|
||||||
if (pages == 0) {
|
|
||||||
cs.sendMessage(GOLD + "----------------------[" + GRAY + "Page 1/1" + GOLD + "]----------------------");
|
|
||||||
cs.sendMessage(GRAY + "Group: " + color + groupName);
|
|
||||||
cs.sendMessage(GRAY + "There are no users in this group.");
|
|
||||||
cs.sendMessage(MENU_END);
|
|
||||||
} else {
|
|
||||||
cs.sendMessage(RED + "Page not found. Requested " + WHITE + page + RED + ", Max " + WHITE + pages);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void playerReport(CommandSender cs, User user, int page) {
|
private void groupReport(CommandSender cs, Group group, int page) {
|
||||||
List<CheckType> types = new ArrayList<CheckType>();
|
List<User> users = USER_MANAGER.getUsersInGroup(group);
|
||||||
for (CheckType type : CheckType.values()) {
|
ChatColor color = group == null ? GREEN : group.getColor();
|
||||||
if (type.getUses(user.getUUID()) > 0) {
|
String groupName = group == null ? "Low" : group.getName();
|
||||||
types.add(type);
|
int pages = (int) Math.ceil(((float) users.size()) / 7);
|
||||||
}
|
if (page <= pages && page > 0) {
|
||||||
}
|
cs.sendMessage(GOLD + "----------------------[" + GRAY + "Page " + page + "/" + pages + "" + GOLD
|
||||||
|
+ "]----------------------");
|
||||||
|
cs.sendMessage(GRAY + "Group: " + color + groupName);
|
||||||
|
for (int x = 0; x < 7; x++) {
|
||||||
|
int index = ((page - 1) * 6) + (x + ((page - 1) * 1));
|
||||||
|
if (index < users.size()) {
|
||||||
|
String player = users.get(index).getName();
|
||||||
|
cs.sendMessage(GRAY + player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cs.sendMessage(MENU_END);
|
||||||
|
} else {
|
||||||
|
if (pages == 0) {
|
||||||
|
cs.sendMessage(GOLD + "----------------------[" + GRAY + "Page 1/1" + GOLD + "]----------------------");
|
||||||
|
cs.sendMessage(GRAY + "Group: " + color + groupName);
|
||||||
|
cs.sendMessage(GRAY + "There are no users in this group.");
|
||||||
|
cs.sendMessage(MENU_END);
|
||||||
|
} else {
|
||||||
|
cs.sendMessage(RED + "Page not found. Requested " + WHITE + page + RED + ", Max " + WHITE + pages);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
UUID uuid = user.getUUID();
|
private void playerReport(CommandSender cs, User user, int page) {
|
||||||
String name = user.getName();
|
List<CheckType> types = new ArrayList<CheckType>();
|
||||||
int pages = (int) Math.ceil(((float) types.size()) / 6);
|
for (CheckType type : CheckType.values()) {
|
||||||
|
if (type.getUses(user.getUUID()) > 0) {
|
||||||
|
types.add(type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Group group = user.getGroup();
|
UUID uuid = user.getUUID();
|
||||||
String groupString = GREEN + "Low";
|
String name = user.getName();
|
||||||
|
int pages = (int) Math.ceil(((float) types.size()) / 6);
|
||||||
|
|
||||||
if (group != null) {
|
Group group = user.getGroup();
|
||||||
groupString = group.getColor() + group.getName();
|
String groupString = GREEN + "Low";
|
||||||
}
|
|
||||||
groupString += " (" + user.getLevel() + ")";
|
|
||||||
|
|
||||||
if (page <= pages && page > 0) {
|
if (group != null) {
|
||||||
cs.sendMessage(GOLD + "----------------------[" + GRAY + "Page " + page + "/" + pages + "" + GOLD + "]----------------------");
|
groupString = group.getColor() + group.getName();
|
||||||
cs.sendMessage(GRAY + "Player: " + WHITE + name);
|
}
|
||||||
cs.sendMessage(GRAY + "Ping: " + WHITE + user.getPing() + "ms " + (user.isLagging() ? ChatColor.RED + "(lagging)" : ChatColor.GREEN + "(not lagging)"));
|
groupString += " (" + user.getLevel() + ")";
|
||||||
cs.sendMessage(GRAY + "Group: " + groupString);
|
|
||||||
for (int x = 0; x < 6; x++) {
|
if (page <= pages && page > 0) {
|
||||||
int index = ((page - 1) * 5) + (x + ((page - 1)));
|
cs.sendMessage(GOLD + "----------------------[" + GRAY + "Page " + page + "/" + pages + "" + GOLD
|
||||||
if (index < types.size()) {
|
+ "]----------------------");
|
||||||
CheckType type = types.get(index);
|
cs.sendMessage(GRAY + "Player: " + WHITE + name);
|
||||||
int use = type.getUses(uuid);
|
int ping = user.getPing();
|
||||||
ChatColor color = WHITE;
|
cs.sendMessage(GRAY + "Ping: " + ((ping == -1) ? (RED + "Offline")
|
||||||
if (use >= 20) {
|
: (WHITE + "" + ping + "ms "
|
||||||
color = YELLOW;
|
+ (user.isLagging() ? ChatColor.RED + "(lagging)" : ChatColor.GREEN + "(not lagging)"))));
|
||||||
} else if (use > 50) {
|
cs.sendMessage(GRAY + "Group: " + groupString);
|
||||||
color = RED;
|
for (int x = 0; x < 6; x++) {
|
||||||
}
|
int index = ((page - 1) * 5) + (x + ((page - 1)));
|
||||||
cs.sendMessage(GRAY + type.getName() + ": " + color + use);
|
if (index < types.size()) {
|
||||||
}
|
CheckType type = types.get(index);
|
||||||
}
|
int use = type.getUses(uuid);
|
||||||
cs.sendMessage(MENU_END);
|
ChatColor color = WHITE;
|
||||||
} else {
|
if (use >= 20) {
|
||||||
if (pages == 0 && page == 1) {
|
color = YELLOW;
|
||||||
cs.sendMessage(GOLD + "----------------------[" + GRAY + "Page 1/1" + GOLD + "]----------------------");
|
} else if (use > 50) {
|
||||||
cs.sendMessage(GRAY + "Player: " + WHITE + name);
|
color = RED;
|
||||||
cs.sendMessage(GRAY + "Ping: " + WHITE + user.getPing() + "ms " + (user.isLagging() ? ChatColor.RED + "(lagging)" : ChatColor.GREEN + "(not lagging)"));
|
}
|
||||||
cs.sendMessage(GRAY + "Group: " + groupString);
|
cs.sendMessage(GRAY + type.getName() + ": " + color + use);
|
||||||
cs.sendMessage(GRAY + "This user has not failed any checks.");
|
}
|
||||||
cs.sendMessage(MENU_END);
|
}
|
||||||
} else {
|
cs.sendMessage(MENU_END);
|
||||||
cs.sendMessage(RED + "Page not found. Requested " + WHITE + page + RED + ", Max " + WHITE + pages + 1);
|
} else {
|
||||||
}
|
if (pages == 0 && page == 1) {
|
||||||
}
|
cs.sendMessage(GOLD + "----------------------[" + GRAY + "Page 1/1" + GOLD + "]----------------------");
|
||||||
}
|
cs.sendMessage(GRAY + "Player: " + WHITE + name);
|
||||||
|
int ping = user.getPing();
|
||||||
|
cs.sendMessage(GRAY + "Ping: " + ((ping == -1) ? (RED + "Offline")
|
||||||
|
: (WHITE + "" + ping + "ms "
|
||||||
|
+ (user.isLagging() ? ChatColor.RED + "(lagging)" : ChatColor.GREEN + "(not lagging)"))));
|
||||||
|
cs.sendMessage(GRAY + "Group: " + groupString);
|
||||||
|
cs.sendMessage(GRAY + "This user has not failed any checks.");
|
||||||
|
cs.sendMessage(MENU_END);
|
||||||
|
} else {
|
||||||
|
cs.sendMessage(RED + "Page not found. Requested " + WHITE + page + RED + ", Max " + WHITE + pages + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -19,8 +19,10 @@
|
|||||||
package com.rammelkast.anticheatreloaded.event;
|
package com.rammelkast.anticheatreloaded.event;
|
||||||
|
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
|
import java.text.DecimalFormatSymbols;
|
||||||
import java.util.EnumMap;
|
import java.util.EnumMap;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
@@ -47,6 +49,11 @@ public class EventListener implements Listener {
|
|||||||
private static final Configuration CONFIG = AntiCheatReloaded.getManager().getConfiguration();
|
private static final Configuration CONFIG = AntiCheatReloaded.getManager().getConfiguration();
|
||||||
private static final DecimalFormat TPS_FORMAT = new DecimalFormat("##.##");
|
private static final DecimalFormat TPS_FORMAT = new DecimalFormat("##.##");
|
||||||
|
|
||||||
|
static {
|
||||||
|
// What the hell, Java..
|
||||||
|
TPS_FORMAT.setDecimalFormatSymbols(DecimalFormatSymbols.getInstance(Locale.ENGLISH));
|
||||||
|
}
|
||||||
|
|
||||||
public static void log(String message, Player player, CheckType type, String subcheck) {
|
public static void log(String message, Player player, CheckType type, String subcheck) {
|
||||||
User user = getUserManager().getUser(player.getUniqueId());
|
User user = getUserManager().getUser(player.getUniqueId());
|
||||||
if (user == null)
|
if (user == null)
|
||||||
|
|||||||
@@ -22,14 +22,10 @@ package com.rammelkast.anticheatreloaded.event;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||||
import org.bukkit.event.inventory.InventoryCloseEvent;
|
|
||||||
import org.bukkit.event.inventory.InventoryOpenEvent;
|
|
||||||
import org.bukkit.event.inventory.InventoryType;
|
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
import com.rammelkast.anticheatreloaded.check.CheckResult;
|
import com.rammelkast.anticheatreloaded.check.CheckResult;
|
||||||
import com.rammelkast.anticheatreloaded.check.CheckType;
|
import com.rammelkast.anticheatreloaded.check.CheckType;
|
||||||
import com.rammelkast.anticheatreloaded.util.User;
|
|
||||||
|
|
||||||
public class InventoryListener extends EventListener {
|
public class InventoryListener extends EventListener {
|
||||||
|
|
||||||
@@ -55,18 +51,4 @@ public class InventoryListener extends EventListener {
|
|||||||
AntiCheatReloaded.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
AntiCheatReloaded.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void onInventoryOpen(InventoryOpenEvent event) {
|
|
||||||
if (event.getInventory().getType() != InventoryType.BEACON) {
|
|
||||||
getUserManager().getUser(event.getPlayer().getUniqueId()).setInventorySnapshot(event.getInventory().getContents());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void onInventoryClose(InventoryCloseEvent event) {
|
|
||||||
User user = getUserManager().getUser(event.getPlayer().getUniqueId());
|
|
||||||
if (user != null) {
|
|
||||||
user.removeInventorySnapshot();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -73,6 +73,7 @@ import com.rammelkast.anticheatreloaded.util.Permission;
|
|||||||
import com.rammelkast.anticheatreloaded.util.User;
|
import com.rammelkast.anticheatreloaded.util.User;
|
||||||
import com.rammelkast.anticheatreloaded.util.Utilities;
|
import com.rammelkast.anticheatreloaded.util.Utilities;
|
||||||
import com.rammelkast.anticheatreloaded.util.VersionUtil;
|
import com.rammelkast.anticheatreloaded.util.VersionUtil;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.XMaterial;
|
||||||
|
|
||||||
public class PlayerListener extends EventListener {
|
public class PlayerListener extends EventListener {
|
||||||
|
|
||||||
@@ -287,7 +288,7 @@ public class PlayerListener extends EventListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!VersionUtil.isBountifulUpdate()) {
|
if (!VersionUtil.isBountifulUpdate()) {
|
||||||
if (itemInHand.getType() == Material.FIREWORK_ROCKET) {
|
if (itemInHand.getType() == XMaterial.FIREWORK_ROCKET.parseMaterial()) {
|
||||||
ElytraCheck.JUMP_Y_VALUE.remove(player.getUniqueId());
|
ElytraCheck.JUMP_Y_VALUE.remove(player.getUniqueId());
|
||||||
if (player.isGliding()) {
|
if (player.isGliding()) {
|
||||||
// TODO config max elytra height?
|
// TODO config max elytra height?
|
||||||
|
|||||||
@@ -1,40 +0,0 @@
|
|||||||
/*
|
|
||||||
* AntiCheatReloaded for Bukkit and Spigot.
|
|
||||||
* Copyright (c) 2012-2015 AntiCheat Team
|
|
||||||
* Copyright (c) 2016-2020 Rammelkast
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
package com.rammelkast.anticheatreloaded.event;
|
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.event.EventHandler;
|
|
||||||
import org.bukkit.event.entity.EntityPotionEffectEvent;
|
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.util.VersionUtil;
|
|
||||||
|
|
||||||
public class PotionEffectListener extends EventListener {
|
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void onEntityPotionEffect(EntityPotionEffectEvent event) {
|
|
||||||
if (!(event.getEntity() instanceof Player))
|
|
||||||
return;
|
|
||||||
if (event.getNewEffect() == null)
|
|
||||||
return;
|
|
||||||
if (!VersionUtil.isLevitationEffect(event.getNewEffect()))
|
|
||||||
return;
|
|
||||||
getBackend().logLevitating((Player) event.getEntity(), event.getNewEffect().getDuration());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,393 @@
|
|||||||
|
/*
|
||||||
|
* ProtocolLib - Bukkit server library that allows access to the Minecraft protocol.
|
||||||
|
* Copyright (C) 2012 Kristian S. Stangeland
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
||||||
|
* GNU General Public License as published by the Free Software Foundation; either version 2 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||||
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
* See the GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along with this program;
|
||||||
|
* if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||||
|
* 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.rammelkast.anticheatreloaded.util;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Locale;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.Server;
|
||||||
|
|
||||||
|
import com.comphenix.protocol.ProtocolLibrary;
|
||||||
|
import com.comphenix.protocol.utility.SnapshotVersion;
|
||||||
|
import com.google.common.base.Objects;
|
||||||
|
import com.google.common.collect.ComparisonChain;
|
||||||
|
import com.google.common.collect.Ordering;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine the current Minecraft version.
|
||||||
|
*
|
||||||
|
* @author Kristian
|
||||||
|
*/
|
||||||
|
public class MinecraftVersion implements Comparable<MinecraftVersion>, Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Regular expression used to parse version strings.
|
||||||
|
*/
|
||||||
|
private static final Pattern VERSION_PATTERN = Pattern.compile(".*\\(.*MC.\\s*([a-zA-z0-9\\-.]+).*");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Version 1.16.2 - breaking change to the nether update
|
||||||
|
*/
|
||||||
|
public static final MinecraftVersion NETHER_UPDATE_2 = new MinecraftVersion("1.16.2");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Version 1.16.0 - the nether update
|
||||||
|
*/
|
||||||
|
public static final MinecraftVersion NETHER_UPDATE = new MinecraftVersion("1.16");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Version 1.15 - the bee update
|
||||||
|
*/
|
||||||
|
public static final MinecraftVersion BEE_UPDATE = new MinecraftVersion("1.15");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Version 1.14 - village and pillage update.
|
||||||
|
*/
|
||||||
|
public static final MinecraftVersion VILLAGE_UPDATE = new MinecraftVersion("1.14");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Version 1.13 - update aquatic.
|
||||||
|
*/
|
||||||
|
public static final MinecraftVersion AQUATIC_UPDATE = new MinecraftVersion("1.13");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Version 1.12 - the world of color update.
|
||||||
|
*/
|
||||||
|
public static final MinecraftVersion COLOR_UPDATE = new MinecraftVersion("1.12");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Version 1.11 - the exploration update.
|
||||||
|
*/
|
||||||
|
public static final MinecraftVersion EXPLORATION_UPDATE = new MinecraftVersion("1.11");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Version 1.10 - the frostburn update.
|
||||||
|
*/
|
||||||
|
public static final MinecraftVersion FROSTBURN_UPDATE = new MinecraftVersion("1.10");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Version 1.9 - the combat update.
|
||||||
|
*/
|
||||||
|
public static final MinecraftVersion COMBAT_UPDATE = new MinecraftVersion("1.9");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Version 1.8 - the "bountiful" update.
|
||||||
|
*/
|
||||||
|
public static final MinecraftVersion BOUNTIFUL_UPDATE = new MinecraftVersion("1.8");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Version 1.7.8 - the update that changed the skin format (and distribution - R.I.P. player disguise)
|
||||||
|
*/
|
||||||
|
public static final MinecraftVersion SKIN_UPDATE = new MinecraftVersion("1.7.8");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Version 1.7.2 - the update that changed the world.
|
||||||
|
*/
|
||||||
|
public static final MinecraftVersion WORLD_UPDATE = new MinecraftVersion("1.7.2");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Version 1.6.1 - the horse update.
|
||||||
|
*/
|
||||||
|
public static final MinecraftVersion HORSE_UPDATE = new MinecraftVersion("1.6.1");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Version 1.5.0 - the redstone update.
|
||||||
|
*/
|
||||||
|
public static final MinecraftVersion REDSTONE_UPDATE = new MinecraftVersion("1.5.0");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Version 1.4.2 - the scary update (Wither Boss).
|
||||||
|
*/
|
||||||
|
public static final MinecraftVersion SCARY_UPDATE = new MinecraftVersion("1.4.2");
|
||||||
|
|
||||||
|
private final int major;
|
||||||
|
private final int minor;
|
||||||
|
private final int build;
|
||||||
|
private Boolean atLeast;
|
||||||
|
|
||||||
|
// The development stage
|
||||||
|
private final String development;
|
||||||
|
|
||||||
|
// Snapshot?
|
||||||
|
private final SnapshotVersion snapshot;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine the current Minecraft version.
|
||||||
|
* @param server - the Bukkit server that will be used to examine the MC version.
|
||||||
|
*/
|
||||||
|
public MinecraftVersion(Server server) {
|
||||||
|
this(extractVersion(server.getVersion()));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Construct a version object from the format major.minor.build, or the snapshot format.
|
||||||
|
* @param versionOnly - the version in text form.
|
||||||
|
*/
|
||||||
|
public MinecraftVersion(String versionOnly) {
|
||||||
|
this(versionOnly, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Construct a version format from the standard release version or the snapshot verison.
|
||||||
|
* @param versionOnly - the version.
|
||||||
|
* @param parseSnapshot - TRUE to parse the snapshot, FALSE otherwise.
|
||||||
|
*/
|
||||||
|
private MinecraftVersion(String versionOnly, boolean parseSnapshot) {
|
||||||
|
String[] section = versionOnly.split("-");
|
||||||
|
SnapshotVersion snapshot = null;
|
||||||
|
int[] numbers = new int[3];
|
||||||
|
|
||||||
|
try {
|
||||||
|
numbers = parseVersion(section[0]);
|
||||||
|
|
||||||
|
} catch (NumberFormatException cause) {
|
||||||
|
// Skip snapshot parsing
|
||||||
|
if (!parseSnapshot)
|
||||||
|
throw cause;
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Determine if the snapshot is newer than the current release version
|
||||||
|
snapshot = new SnapshotVersion(section[0]);
|
||||||
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd", Locale.US);
|
||||||
|
|
||||||
|
MinecraftVersion latest = new MinecraftVersion(ProtocolLibrary.MAXIMUM_MINECRAFT_VERSION, false);
|
||||||
|
boolean newer = snapshot.getSnapshotDate().compareTo(
|
||||||
|
format.parse(ProtocolLibrary.MINECRAFT_LAST_RELEASE_DATE)) > 0;
|
||||||
|
|
||||||
|
numbers[0] = latest.getMajor();
|
||||||
|
numbers[1] = latest.getMinor() + (newer ? 1 : -1);
|
||||||
|
numbers[2] = 0;
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new IllegalStateException("Cannot parse " + section[0], e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.major = numbers[0];
|
||||||
|
this.minor = numbers[1];
|
||||||
|
this.build = numbers[2];
|
||||||
|
this.development = section.length > 1 ? section[1] : (snapshot != null ? "snapshot" : null);
|
||||||
|
this.snapshot = snapshot;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Construct a version object directly.
|
||||||
|
* @param major - major version number.
|
||||||
|
* @param minor - minor version number.
|
||||||
|
* @param build - build version number.
|
||||||
|
*/
|
||||||
|
public MinecraftVersion(int major, int minor, int build) {
|
||||||
|
this(major, minor, build, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Construct a version object directly.
|
||||||
|
* @param major - major version number.
|
||||||
|
* @param minor - minor version number.
|
||||||
|
* @param build - build version number.
|
||||||
|
* @param development - development stage.
|
||||||
|
*/
|
||||||
|
public MinecraftVersion(int major, int minor, int build, String development) {
|
||||||
|
this.major = major;
|
||||||
|
this.minor = minor;
|
||||||
|
this.build = build;
|
||||||
|
this.development = development;
|
||||||
|
this.snapshot = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int[] parseVersion(String version) {
|
||||||
|
String[] elements = version.split("\\.");
|
||||||
|
int[] numbers = new int[3];
|
||||||
|
|
||||||
|
// Make sure it's even a valid version
|
||||||
|
if (elements.length < 1)
|
||||||
|
throw new IllegalStateException("Corrupt MC version: " + version);
|
||||||
|
|
||||||
|
// The String 1 or 1.2 is interpreted as 1.0.0 and 1.2.0 respectively.
|
||||||
|
for (int i = 0; i < Math.min(numbers.length, elements.length); i++)
|
||||||
|
numbers[i] = Integer.parseInt(elements[i].trim());
|
||||||
|
return numbers;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Major version number
|
||||||
|
* @return Current major version number.
|
||||||
|
*/
|
||||||
|
public int getMajor() {
|
||||||
|
return major;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Minor version number
|
||||||
|
* @return Current minor version number.
|
||||||
|
*/
|
||||||
|
public int getMinor() {
|
||||||
|
return minor;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build version number
|
||||||
|
* @return Current build version number.
|
||||||
|
*/
|
||||||
|
public int getBuild() {
|
||||||
|
return build;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve the development stage.
|
||||||
|
* @return Development stage, or NULL if this is a release.
|
||||||
|
*/
|
||||||
|
public String getDevelopmentStage() {
|
||||||
|
return development;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve the snapshot version, or NULL if this is a release.
|
||||||
|
* @return The snapshot version.
|
||||||
|
*/
|
||||||
|
public SnapshotVersion getSnapshot() {
|
||||||
|
return snapshot;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine if this version is a snapshot.
|
||||||
|
* @return The snapshot version.
|
||||||
|
*/
|
||||||
|
public boolean isSnapshot() {
|
||||||
|
return snapshot != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean atOrAbove() {
|
||||||
|
if (atLeast == null) {
|
||||||
|
atLeast = MinecraftVersion.atOrAbove(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
return atLeast;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve the version String (major.minor.build) only.
|
||||||
|
* @return A normal version string.
|
||||||
|
*/
|
||||||
|
public String getVersion() {
|
||||||
|
if (getDevelopmentStage() == null)
|
||||||
|
return String.format("%s.%s.%s", getMajor(), getMinor(), getBuild());
|
||||||
|
else
|
||||||
|
return String.format("%s.%s.%s-%s%s", getMajor(), getMinor(), getBuild(),
|
||||||
|
getDevelopmentStage(), isSnapshot() ? snapshot : "");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int compareTo(MinecraftVersion o) {
|
||||||
|
if (o == null)
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
return ComparisonChain.start().
|
||||||
|
compare(getMajor(), o.getMajor()).
|
||||||
|
compare(getMinor(), o.getMinor()).
|
||||||
|
compare(getBuild(), o.getBuild()).
|
||||||
|
// No development String means it's a release
|
||||||
|
compare(getDevelopmentStage(), o.getDevelopmentStage(), Ordering.natural().nullsLast()).
|
||||||
|
compare(getSnapshot(), o.getSnapshot(), Ordering.natural().nullsFirst()).
|
||||||
|
result();
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isAtLeast(MinecraftVersion other) {
|
||||||
|
if (other == null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return compareTo(other) >= 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object obj) {
|
||||||
|
if (obj == null)
|
||||||
|
return false;
|
||||||
|
if (obj == this)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if (obj instanceof MinecraftVersion) {
|
||||||
|
MinecraftVersion other = (MinecraftVersion) obj;
|
||||||
|
|
||||||
|
return getMajor() == other.getMajor() &&
|
||||||
|
getMinor() == other.getMinor() &&
|
||||||
|
getBuild() == other.getBuild() &&
|
||||||
|
Objects.equal(getDevelopmentStage(), other.getDevelopmentStage());
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hashCode(getMajor(), getMinor(), getBuild());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
// Convert to a String that we can parse back again
|
||||||
|
return String.format("(MC: %s)", getVersion());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extract the Minecraft version from CraftBukkit itself.
|
||||||
|
* @param text - the server version in text form.
|
||||||
|
* @return The underlying MC version.
|
||||||
|
* @throws IllegalStateException If we could not parse the version string.
|
||||||
|
*/
|
||||||
|
public static String extractVersion(String text) {
|
||||||
|
Matcher version = VERSION_PATTERN.matcher(text);
|
||||||
|
|
||||||
|
if (version.matches() && version.group(1) != null) {
|
||||||
|
return version.group(1);
|
||||||
|
} else {
|
||||||
|
throw new IllegalStateException("Cannot parse version String '" + text + "'");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parse the given server version into a Minecraft version.
|
||||||
|
* @param serverVersion - the server version.
|
||||||
|
* @return The resulting Minecraft version.
|
||||||
|
*/
|
||||||
|
public static MinecraftVersion fromServerVersion(String serverVersion) {
|
||||||
|
return new MinecraftVersion(extractVersion(serverVersion));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static MinecraftVersion currentVersion;
|
||||||
|
|
||||||
|
public static void setCurrentVersion(MinecraftVersion version) {
|
||||||
|
currentVersion = version;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static MinecraftVersion getCurrentVersion() {
|
||||||
|
if (currentVersion == null) {
|
||||||
|
currentVersion = fromServerVersion(Bukkit.getVersion());
|
||||||
|
}
|
||||||
|
|
||||||
|
return currentVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean atOrAbove(MinecraftVersion version) {
|
||||||
|
return getCurrentVersion().isAtLeast(version);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -20,6 +20,7 @@ package com.rammelkast.anticheatreloaded.util;
|
|||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.potion.PotionEffect;
|
||||||
import org.bukkit.potion.PotionEffectType;
|
import org.bukkit.potion.PotionEffectType;
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
@@ -88,6 +89,12 @@ public class MovementManager {
|
|||||||
public boolean hasSpeedEffect = false;
|
public boolean hasSpeedEffect = false;
|
||||||
// If the player had speed effect previous tick
|
// If the player had speed effect previous tick
|
||||||
public boolean hadSpeedEffect = false;
|
public boolean hadSpeedEffect = false;
|
||||||
|
// If the player has a speed increasing effect
|
||||||
|
public boolean hasIncreasingEffect = false;
|
||||||
|
// If the player had a speed increasing effect previous tick
|
||||||
|
public boolean hadIncreasingEffect = false;
|
||||||
|
// Riptiding ticks
|
||||||
|
public int riptideTicks;
|
||||||
// Time of last update
|
// Time of last update
|
||||||
public long lastUpdate;
|
public long lastUpdate;
|
||||||
|
|
||||||
@@ -111,6 +118,15 @@ public class MovementManager {
|
|||||||
if (Utilities.couldBeOnBoat(player, 0.25, true) && !Utilities.isSubmersed(player))
|
if (Utilities.couldBeOnBoat(player, 0.25, true) && !Utilities.isSubmersed(player))
|
||||||
this.onGround = true;
|
this.onGround = true;
|
||||||
|
|
||||||
|
// Handle 1.9+ potion effects
|
||||||
|
if (MinecraftVersion.atOrAbove(MinecraftVersion.COMBAT_UPDATE)) {
|
||||||
|
for (PotionEffect effect : player.getActivePotionEffects()) {
|
||||||
|
if (!VersionUtil.isLevitationEffect(effect))
|
||||||
|
return;
|
||||||
|
AntiCheatReloaded.getManager().getBackend().logLevitating(player, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.touchedGroundThisTick = false;
|
this.touchedGroundThisTick = false;
|
||||||
this.halfMovement = false;
|
this.halfMovement = false;
|
||||||
if (!this.onGround) {
|
if (!this.onGround) {
|
||||||
@@ -168,8 +184,22 @@ public class MovementManager {
|
|||||||
this.nearLiquidTicks = 0;
|
this.nearLiquidTicks = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (VersionUtil.CURRENT_VERSION.isAtLeast(MinecraftVersion.AQUATIC_UPDATE)) {
|
||||||
|
if (player.isRiptiding()) {
|
||||||
|
this.riptideTicks = 30;
|
||||||
|
} else {
|
||||||
|
if (this.riptideTicks > 0)
|
||||||
|
this.riptideTicks--;
|
||||||
|
else
|
||||||
|
this.riptideTicks = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.hadSpeedEffect = this.hasSpeedEffect;
|
this.hadSpeedEffect = this.hasSpeedEffect;
|
||||||
this.hasSpeedEffect = player.hasPotionEffect(PotionEffectType.SPEED);
|
this.hasSpeedEffect = player.hasPotionEffect(PotionEffectType.SPEED);
|
||||||
|
|
||||||
|
this.hadIncreasingEffect = this.hasIncreasingEffect;
|
||||||
|
this.hasIncreasingEffect = !player.getActivePotionEffects().isEmpty();
|
||||||
|
|
||||||
double lastDistanceSq = Math.sqrt(this.lastDistance.getXDifference() * this.lastDistance.getXDifference()
|
double lastDistanceSq = Math.sqrt(this.lastDistance.getXDifference() * this.lastDistance.getXDifference()
|
||||||
+ this.lastDistance.getZDifference() * this.lastDistance.getZDifference());
|
+ this.lastDistance.getZDifference() * this.lastDistance.getZDifference());
|
||||||
|
|||||||
@@ -20,15 +20,12 @@
|
|||||||
package com.rammelkast.anticheatreloaded.util;
|
package com.rammelkast.anticheatreloaded.util;
|
||||||
|
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.Inventory;
|
|
||||||
import org.bukkit.inventory.ItemStack;
|
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
import com.rammelkast.anticheatreloaded.check.CheckType;
|
import com.rammelkast.anticheatreloaded.check.CheckType;
|
||||||
@@ -41,7 +38,6 @@ public class User {
|
|||||||
private final int id;
|
private final int id;
|
||||||
private int level = 0;
|
private int level = 0;
|
||||||
private Location goodLocation;
|
private Location goodLocation;
|
||||||
private List<ItemStack> inventorySnapshot = null;
|
|
||||||
private Configuration config = AntiCheatReloaded.getManager().getConfiguration();
|
private Configuration config = AntiCheatReloaded.getManager().getConfiguration();
|
||||||
private int toX, toY, toZ;
|
private int toX, toY, toZ;
|
||||||
private String[] messages = new String[2];
|
private String[] messages = new String[2];
|
||||||
@@ -245,44 +241,7 @@ public class User {
|
|||||||
goodLocation = location;
|
goodLocation = location;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Store a copy of the player's inventory, for use in resetting
|
|
||||||
*
|
|
||||||
* @param is ItemStack list to store
|
|
||||||
*/
|
|
||||||
public void setInventorySnapshot(ItemStack[] is) {
|
|
||||||
inventorySnapshot = new ArrayList<ItemStack>();
|
|
||||||
for (int i = 0; i < is.length; i++) {
|
|
||||||
if (is[i] != null) {
|
|
||||||
inventorySnapshot.add(is[i].clone());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Remove the current inventory snapshot
|
|
||||||
*/
|
|
||||||
public void removeInventorySnapshot() {
|
|
||||||
inventorySnapshot = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Restore the player's inventory with the current inventory snapshot
|
|
||||||
*
|
|
||||||
* @param inventory Player's inventory
|
|
||||||
*/
|
|
||||||
public void restoreInventory(Inventory inventory) {
|
|
||||||
if (inventorySnapshot != null) {
|
|
||||||
inventory.clear();
|
|
||||||
for (ItemStack is : inventorySnapshot) {
|
|
||||||
if (is != null) {
|
|
||||||
inventory.addItem(is);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the player's to location
|
* Set the player's to location
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -45,9 +45,6 @@ public final class Utilities {
|
|||||||
private static final List<Material> FOOD = new ArrayList<Material>();
|
private static final List<Material> FOOD = new ArrayList<Material>();
|
||||||
private static final List<Material> CLIMBABLE = new ArrayList<Material>();
|
private static final List<Material> CLIMBABLE = new ArrayList<Material>();
|
||||||
private static final Map<Material, Material> COMBO = new HashMap<Material, Material>();
|
private static final Map<Material, Material> COMBO = new HashMap<Material, Material>();
|
||||||
|
|
||||||
public static final Material LILY_PAD;
|
|
||||||
public static final Material COB_WEB;
|
|
||||||
|
|
||||||
public static final double JUMP_MOTION_Y = 0.41999998688697815;
|
public static final double JUMP_MOTION_Y = 0.41999998688697815;
|
||||||
|
|
||||||
@@ -188,8 +185,10 @@ public final class Utilities {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isNearShulkerBox(Location location) {
|
public static boolean isNearShulkerBox(Location location) {
|
||||||
if (VersionUtil.isBountifulUpdate())
|
// Shulkers are 1.12+
|
||||||
|
if (MinecraftVersion.getCurrentVersion().isAtLeast(MinecraftVersion.COLOR_UPDATE)) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
return isShulkerBox(location.getBlock()) || isShulkerBox(location.getBlock().getRelative(BlockFace.NORTH))
|
return isShulkerBox(location.getBlock()) || isShulkerBox(location.getBlock().getRelative(BlockFace.NORTH))
|
||||||
|| isShulkerBox(location.getBlock().getRelative(BlockFace.SOUTH))
|
|| isShulkerBox(location.getBlock().getRelative(BlockFace.SOUTH))
|
||||||
|| isShulkerBox(location.getBlock().getRelative(BlockFace.EAST))
|
|| isShulkerBox(location.getBlock().getRelative(BlockFace.EAST))
|
||||||
@@ -225,7 +224,8 @@ public final class Utilities {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isHalfblock(Block block) {
|
public static boolean isHalfblock(Block block) {
|
||||||
if (!VersionUtil.isBountifulUpdate()) {
|
// getBoundingBox() is only available on 1.14+
|
||||||
|
if (MinecraftVersion.getCurrentVersion().isAtLeast(MinecraftVersion.VILLAGE_UPDATE)) {
|
||||||
BoundingBox box = block.getBoundingBox();
|
BoundingBox box = block.getBoundingBox();
|
||||||
double height = box.getMaxY() - box.getMinY();
|
double height = box.getMaxY() - box.getMinY();
|
||||||
if (height > 0.42 && height <= 0.6 && block.getType().isSolid())
|
if (height > 0.42 && height <= 0.6 && block.getType().isSolid())
|
||||||
@@ -431,10 +431,11 @@ public final class Utilities {
|
|||||||
*/
|
*/
|
||||||
public static boolean isOnLilyPad(Player player) {
|
public static boolean isOnLilyPad(Player player) {
|
||||||
Block block = player.getLocation().getBlock();
|
Block block = player.getLocation().getBlock();
|
||||||
return block.getType() == LILY_PAD || block.getRelative(BlockFace.NORTH).getType() == LILY_PAD
|
return block.getType() == XMaterial.LILY_PAD.parseMaterial()
|
||||||
|| block.getRelative(BlockFace.SOUTH).getType() == LILY_PAD
|
|| block.getRelative(BlockFace.NORTH).getType() == XMaterial.LILY_PAD.parseMaterial()
|
||||||
|| block.getRelative(BlockFace.EAST).getType() == LILY_PAD
|
|| block.getRelative(BlockFace.SOUTH).getType() == XMaterial.LILY_PAD.parseMaterial()
|
||||||
|| block.getRelative(BlockFace.WEST).getType() == LILY_PAD;
|
|| block.getRelative(BlockFace.EAST).getType() == XMaterial.LILY_PAD.parseMaterial()
|
||||||
|
|| block.getRelative(BlockFace.WEST).getType() == XMaterial.LILY_PAD.parseMaterial();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -458,7 +459,7 @@ public final class Utilities {
|
|||||||
return player.getLocation().getBlock().isLiquid()
|
return player.getLocation().getBlock().isLiquid()
|
||||||
|| player.getLocation().getBlock().getRelative(BlockFace.DOWN).isLiquid()
|
|| player.getLocation().getBlock().getRelative(BlockFace.DOWN).isLiquid()
|
||||||
|| player.getLocation().getBlock().getRelative(BlockFace.UP).isLiquid()
|
|| player.getLocation().getBlock().getRelative(BlockFace.UP).isLiquid()
|
||||||
|| (!VersionUtil.isBountifulUpdate()
|
|| (MinecraftVersion.getCurrentVersion().isAtLeast(MinecraftVersion.AQUATIC_UPDATE)
|
||||||
&& (player.getLocation().getBlock().getType() == XMaterial.KELP_PLANT.parseMaterial()
|
&& (player.getLocation().getBlock().getType() == XMaterial.KELP_PLANT.parseMaterial()
|
||||||
|| player.getLocation().getBlock().getRelative(BlockFace.UP)
|
|| player.getLocation().getBlock().getRelative(BlockFace.UP)
|
||||||
.getType() == XMaterial.KELP_PLANT.parseMaterial()
|
.getType() == XMaterial.KELP_PLANT.parseMaterial()
|
||||||
@@ -486,6 +487,26 @@ public final class Utilities {
|
|||||||
|| player.getLocation().getBlock().getRelative(BlockFace.SOUTH_EAST).isLiquid()
|
|| player.getLocation().getBlock().getRelative(BlockFace.SOUTH_EAST).isLiquid()
|
||||||
|| player.getLocation().getBlock().getRelative(BlockFace.SOUTH_WEST).isLiquid();
|
|| player.getLocation().getBlock().getRelative(BlockFace.SOUTH_WEST).isLiquid();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine whether a location is near a liquid block
|
||||||
|
*
|
||||||
|
* @param location Location to check
|
||||||
|
* @return true if near liquid block
|
||||||
|
*/
|
||||||
|
public static boolean isNearWater(Location location) {
|
||||||
|
return location.getBlock().isLiquid()
|
||||||
|
|| location.getBlock().getRelative(BlockFace.UP).isLiquid()
|
||||||
|
|| location.getBlock().getRelative(BlockFace.DOWN).isLiquid()
|
||||||
|
|| location.getBlock().getRelative(BlockFace.NORTH).isLiquid()
|
||||||
|
|| location.getBlock().getRelative(BlockFace.SOUTH).isLiquid()
|
||||||
|
|| location.getBlock().getRelative(BlockFace.EAST).isLiquid()
|
||||||
|
|| location.getBlock().getRelative(BlockFace.WEST).isLiquid()
|
||||||
|
|| location.getBlock().getRelative(BlockFace.NORTH_EAST).isLiquid()
|
||||||
|
|| location.getBlock().getRelative(BlockFace.NORTH_WEST).isLiquid()
|
||||||
|
|| location.getBlock().getRelative(BlockFace.SOUTH_EAST).isLiquid()
|
||||||
|
|| location.getBlock().getRelative(BlockFace.SOUTH_WEST).isLiquid();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine whether a player is surrounded by liquid blocks
|
* Determine whether a player is surrounded by liquid blocks
|
||||||
@@ -504,7 +525,7 @@ public final class Utilities {
|
|||||||
&& location.getBlock().getRelative(BlockFace.SOUTH_EAST).isLiquid()
|
&& location.getBlock().getRelative(BlockFace.SOUTH_EAST).isLiquid()
|
||||||
&& location.getBlock().getRelative(BlockFace.SOUTH_WEST).isLiquid();
|
&& location.getBlock().getRelative(BlockFace.SOUTH_WEST).isLiquid();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine whether a player is near a web
|
* Determine whether a player is near a web
|
||||||
*
|
*
|
||||||
@@ -520,7 +541,6 @@ public final class Utilities {
|
|||||||
|| isWeb(player.getLocation().getBlock().getRelative(BlockFace.EAST))
|
|| isWeb(player.getLocation().getBlock().getRelative(BlockFace.EAST))
|
||||||
|| isWeb(player.getLocation().getBlock().getRelative(BlockFace.WEST));
|
|| isWeb(player.getLocation().getBlock().getRelative(BlockFace.WEST));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine whether a block is a web
|
* Determine whether a block is a web
|
||||||
@@ -529,7 +549,7 @@ public final class Utilities {
|
|||||||
* @return true if web
|
* @return true if web
|
||||||
*/
|
*/
|
||||||
public static boolean isWeb(Block block) {
|
public static boolean isWeb(Block block) {
|
||||||
return block.getType() == COB_WEB;
|
return block.getType() == XMaterial.COBWEB.parseMaterial();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -539,9 +559,11 @@ public final class Utilities {
|
|||||||
* @return true if in web
|
* @return true if in web
|
||||||
*/
|
*/
|
||||||
public static boolean isInWeb(Player player) {
|
public static boolean isInWeb(Player player) {
|
||||||
return player.getLocation().getBlock().getType() == COB_WEB
|
return player.getLocation().getBlock().getType() == XMaterial.COBWEB.parseMaterial()
|
||||||
|| player.getLocation().getBlock().getRelative(BlockFace.DOWN).getType() == COB_WEB
|
|| player.getLocation().getBlock().getRelative(BlockFace.DOWN).getType() == XMaterial.COBWEB
|
||||||
|| player.getLocation().getBlock().getRelative(BlockFace.UP).getType() == COB_WEB;
|
.parseMaterial()
|
||||||
|
|| player.getLocation().getBlock().getRelative(BlockFace.UP).getType() == XMaterial.COBWEB
|
||||||
|
.parseMaterial();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -779,7 +801,7 @@ public final class Utilities {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isHoneyBlock(Block block) {
|
public static boolean isHoneyBlock(Block block) {
|
||||||
if (!VersionUtil.isOfVersion("v1_15")) {
|
if (MinecraftVersion.getCurrentVersion().isAtLeast(MinecraftVersion.BEE_UPDATE)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return block.getType() == XMaterial.HONEY_BLOCK.parseMaterial();
|
return block.getType() == XMaterial.HONEY_BLOCK.parseMaterial();
|
||||||
@@ -788,240 +810,233 @@ public final class Utilities {
|
|||||||
static {
|
static {
|
||||||
// Start 1.8.8
|
// Start 1.8.8
|
||||||
if (VersionUtil.isBountifulUpdate()) {
|
if (VersionUtil.isBountifulUpdate()) {
|
||||||
LILY_PAD = XMaterial.LILY_PAD.parseMaterial();
|
|
||||||
COB_WEB = XMaterial.COBWEB.parseMaterial();
|
|
||||||
|
|
||||||
// Start instant break materials
|
// Start instant break materials
|
||||||
INSTANT_BREAK.add(XMaterial.COMPARATOR.parseMaterial());
|
INSTANT_BREAK.add(XMaterial.COMPARATOR.parseMaterial());
|
||||||
INSTANT_BREAK.add(XMaterial.REPEATER.parseMaterial());
|
INSTANT_BREAK.add(XMaterial.REPEATER.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.TORCH);
|
INSTANT_BREAK.add(XMaterial.TORCH.parseMaterial());
|
||||||
INSTANT_BREAK.add(XMaterial.REDSTONE_TORCH.parseMaterial());
|
INSTANT_BREAK.add(XMaterial.REDSTONE_TORCH.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.REDSTONE_WIRE);
|
INSTANT_BREAK.add(XMaterial.REDSTONE_WIRE.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.TRIPWIRE);
|
INSTANT_BREAK.add(XMaterial.TRIPWIRE.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.TRIPWIRE_HOOK);
|
INSTANT_BREAK.add(XMaterial.TRIPWIRE_HOOK.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.FIRE);
|
INSTANT_BREAK.add(XMaterial.FIRE.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.FLOWER_POT);
|
INSTANT_BREAK.add(XMaterial.FLOWER_POT.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.TNT);
|
INSTANT_BREAK.add(XMaterial.TNT.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.SLIME_BLOCK);
|
INSTANT_BREAK.add(XMaterial.SLIME_BLOCK.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.CARROT);
|
INSTANT_BREAK.add(XMaterial.CARROT.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.DEAD_BUSH);
|
INSTANT_BREAK.add(XMaterial.DEAD_BUSH.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.GRASS);
|
INSTANT_BREAK.add(XMaterial.GRASS.parseMaterial());
|
||||||
INSTANT_BREAK.add(XMaterial.TALL_GRASS.parseMaterial());
|
INSTANT_BREAK.add(XMaterial.TALL_GRASS.parseMaterial());
|
||||||
INSTANT_BREAK.add(LILY_PAD);
|
INSTANT_BREAK.add(XMaterial.LILY_PAD.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.MELON_STEM);
|
INSTANT_BREAK.add(XMaterial.MELON_STEM.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.MELON_STEM);
|
INSTANT_BREAK.add(XMaterial.MELON_STEM.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.BROWN_MUSHROOM);
|
INSTANT_BREAK.add(XMaterial.BROWN_MUSHROOM.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.RED_MUSHROOM);
|
INSTANT_BREAK.add(XMaterial.RED_MUSHROOM.parseMaterial());
|
||||||
INSTANT_BREAK.add(XMaterial.NETHER_WART.parseMaterial());
|
INSTANT_BREAK.add(XMaterial.NETHER_WART.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.POTATO);
|
INSTANT_BREAK.add(XMaterial.POTATO.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.PUMPKIN_STEM);
|
INSTANT_BREAK.add(XMaterial.PUMPKIN_STEM.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.PUMPKIN_STEM);
|
INSTANT_BREAK.add(XMaterial.PUMPKIN_STEM.parseMaterial());
|
||||||
INSTANT_BREAK.add(XMaterial.OAK_SAPLING.parseMaterial());
|
INSTANT_BREAK.add(XMaterial.OAK_SAPLING.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.SUGAR_CANE);
|
INSTANT_BREAK.add(XMaterial.SUGAR_CANE.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.WHEAT);
|
INSTANT_BREAK.add(XMaterial.WHEAT.parseMaterial());
|
||||||
// End instant break materials
|
// End instant break materials
|
||||||
|
|
||||||
// Start food
|
// Start food
|
||||||
FOOD.add(Material.APPLE);
|
FOOD.add(XMaterial.APPLE.parseMaterial());
|
||||||
FOOD.add(Material.BAKED_POTATO);
|
FOOD.add(XMaterial.BAKED_POTATO.parseMaterial());
|
||||||
FOOD.add(Material.BREAD);
|
FOOD.add(XMaterial.BREAD.parseMaterial());
|
||||||
FOOD.add(Material.CAKE);
|
FOOD.add(XMaterial.CAKE.parseMaterial());
|
||||||
FOOD.add(Material.CARROT);
|
FOOD.add(XMaterial.CARROT.parseMaterial());
|
||||||
FOOD.add(Material.COOKED_CHICKEN);
|
FOOD.add(XMaterial.COOKED_CHICKEN.parseMaterial());
|
||||||
FOOD.add(XMaterial.COOKED_COD.parseMaterial());
|
FOOD.add(XMaterial.COOKED_COD.parseMaterial());
|
||||||
FOOD.add(XMaterial.COD.parseMaterial());
|
FOOD.add(XMaterial.COD.parseMaterial());
|
||||||
FOOD.add(Material.COOKED_MUTTON);
|
FOOD.add(XMaterial.COOKED_MUTTON.parseMaterial());
|
||||||
FOOD.add(XMaterial.COOKED_PORKCHOP.parseMaterial());
|
FOOD.add(XMaterial.COOKED_PORKCHOP.parseMaterial());
|
||||||
FOOD.add(Material.COOKED_RABBIT);
|
FOOD.add(XMaterial.COOKED_RABBIT.parseMaterial());
|
||||||
FOOD.add(Material.COOKIE);
|
FOOD.add(XMaterial.COOKIE.parseMaterial());
|
||||||
FOOD.add(Material.GOLDEN_APPLE);
|
FOOD.add(XMaterial.GOLDEN_APPLE.parseMaterial());
|
||||||
FOOD.add(Material.GOLDEN_CARROT);
|
FOOD.add(XMaterial.GOLDEN_CARROT.parseMaterial());
|
||||||
FOOD.add(XMaterial.GLISTERING_MELON_SLICE.parseMaterial());
|
FOOD.add(XMaterial.GLISTERING_MELON_SLICE.parseMaterial());
|
||||||
FOOD.add(XMaterial.MUSHROOM_STEM.parseMaterial());
|
FOOD.add(XMaterial.MUSHROOM_STEM.parseMaterial());
|
||||||
FOOD.add(Material.POISONOUS_POTATO);
|
FOOD.add(XMaterial.POISONOUS_POTATO.parseMaterial());
|
||||||
FOOD.add(Material.POTATO);
|
FOOD.add(XMaterial.POTATO.parseMaterial());
|
||||||
FOOD.add(Material.PUMPKIN_PIE);
|
FOOD.add(XMaterial.PUMPKIN_PIE.parseMaterial());
|
||||||
FOOD.add(Material.RABBIT_STEW);
|
FOOD.add(XMaterial.RABBIT_STEW.parseMaterial());
|
||||||
FOOD.add(Material.COOKED_BEEF);
|
FOOD.add(XMaterial.COOKED_BEEF.parseMaterial());
|
||||||
FOOD.add(XMaterial.BEEF.parseMaterial());
|
FOOD.add(XMaterial.BEEF.parseMaterial());
|
||||||
FOOD.add(Material.COOKED_CHICKEN);
|
FOOD.add(XMaterial.COOKED_CHICKEN.parseMaterial());
|
||||||
FOOD.add(XMaterial.CHICKEN.parseMaterial());
|
FOOD.add(XMaterial.CHICKEN.parseMaterial());
|
||||||
FOOD.add(Material.MUTTON);
|
FOOD.add(XMaterial.MUTTON.parseMaterial());
|
||||||
FOOD.add(XMaterial.PORKCHOP.parseMaterial());
|
FOOD.add(XMaterial.PORKCHOP.parseMaterial());
|
||||||
FOOD.add(Material.RABBIT);
|
FOOD.add(XMaterial.RABBIT.parseMaterial());
|
||||||
FOOD.add(Material.COOKED_RABBIT);
|
FOOD.add(XMaterial.COOKED_RABBIT.parseMaterial());
|
||||||
FOOD.add(Material.ROTTEN_FLESH);
|
FOOD.add(XMaterial.ROTTEN_FLESH.parseMaterial());
|
||||||
FOOD.add(Material.SPIDER_EYE);
|
FOOD.add(XMaterial.SPIDER_EYE.parseMaterial());
|
||||||
|
|
||||||
// Start combos
|
// Start combos
|
||||||
COMBO.put(Material.SHEARS, XMaterial.WHITE_WOOL.parseMaterial());
|
COMBO.put(XMaterial.SHEARS.parseMaterial(), XMaterial.WHITE_WOOL.parseMaterial());
|
||||||
|
|
||||||
COMBO.put(Material.IRON_SWORD, COB_WEB);
|
COMBO.put(XMaterial.IRON_SWORD.parseMaterial(), XMaterial.COBWEB.parseMaterial());
|
||||||
COMBO.put(Material.DIAMOND_SWORD, COB_WEB);
|
COMBO.put(XMaterial.DIAMOND_SWORD.parseMaterial(), XMaterial.COBWEB.parseMaterial());
|
||||||
COMBO.put(Material.STONE_SWORD, COB_WEB);
|
COMBO.put(XMaterial.STONE_SWORD.parseMaterial(), XMaterial.COBWEB.parseMaterial());
|
||||||
COMBO.put(XMaterial.WOODEN_SWORD.parseMaterial(), COB_WEB);
|
COMBO.put(XMaterial.WOODEN_SWORD.parseMaterial(), XMaterial.COBWEB.parseMaterial());
|
||||||
// End combos
|
// End combos
|
||||||
|
|
||||||
// Start climbable
|
// Start climbable
|
||||||
CLIMBABLE.add(Material.VINE);
|
CLIMBABLE.add(XMaterial.VINE.parseMaterial());
|
||||||
CLIMBABLE.add(Material.LADDER);
|
CLIMBABLE.add(XMaterial.LADDER.parseMaterial());
|
||||||
CLIMBABLE.add(Material.WATER);
|
CLIMBABLE.add(XMaterial.WATER.parseMaterial());
|
||||||
// End climbable
|
// End climbable
|
||||||
}
|
}
|
||||||
// End 1.8.8
|
// End 1.8.8
|
||||||
// Start other version
|
// Start other version
|
||||||
else {
|
else {
|
||||||
LILY_PAD = Material.LILY_PAD;
|
MinecraftVersion currentVersion = MinecraftVersion.getCurrentVersion();
|
||||||
COB_WEB = Material.COBWEB;
|
|
||||||
|
|
||||||
// Start instant break materials
|
// Start instant break materials
|
||||||
INSTANT_BREAK.add(Material.COMPARATOR);
|
INSTANT_BREAK.add(XMaterial.COMPARATOR.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.REPEATER);
|
INSTANT_BREAK.add(XMaterial.REPEATER.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.TORCH);
|
INSTANT_BREAK.add(XMaterial.TORCH.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.REDSTONE_TORCH);
|
INSTANT_BREAK.add(XMaterial.REDSTONE_TORCH.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.REDSTONE_WIRE);
|
INSTANT_BREAK.add(XMaterial.REDSTONE_WIRE.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.TRIPWIRE);
|
INSTANT_BREAK.add(XMaterial.TRIPWIRE.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.TRIPWIRE_HOOK);
|
INSTANT_BREAK.add(XMaterial.TRIPWIRE_HOOK.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.FIRE);
|
INSTANT_BREAK.add(XMaterial.FIRE.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.FLOWER_POT);
|
INSTANT_BREAK.add(XMaterial.FLOWER_POT.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.INFESTED_CHISELED_STONE_BRICKS);
|
INSTANT_BREAK.add(XMaterial.INFESTED_CHISELED_STONE_BRICKS.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.INFESTED_COBBLESTONE);
|
INSTANT_BREAK.add(XMaterial.INFESTED_COBBLESTONE.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.INFESTED_CRACKED_STONE_BRICKS);
|
INSTANT_BREAK.add(XMaterial.INFESTED_CRACKED_STONE_BRICKS.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.INFESTED_MOSSY_STONE_BRICKS);
|
INSTANT_BREAK.add(XMaterial.INFESTED_MOSSY_STONE_BRICKS.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.INFESTED_STONE);
|
INSTANT_BREAK.add(XMaterial.INFESTED_STONE.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.INFESTED_STONE_BRICKS);
|
INSTANT_BREAK.add(XMaterial.INFESTED_STONE_BRICKS.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.TNT);
|
INSTANT_BREAK.add(XMaterial.TNT.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.SLIME_BLOCK);
|
INSTANT_BREAK.add(XMaterial.SLIME_BLOCK.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.CARROTS);
|
INSTANT_BREAK.add(XMaterial.CARROTS.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.DEAD_BUSH);
|
INSTANT_BREAK.add(XMaterial.DEAD_BUSH.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.FERN);
|
INSTANT_BREAK.add(XMaterial.FERN.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.LARGE_FERN);
|
INSTANT_BREAK.add(XMaterial.LARGE_FERN.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.CHORUS_FLOWER);
|
INSTANT_BREAK.add(XMaterial.CHORUS_FLOWER.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.SUNFLOWER);
|
INSTANT_BREAK.add(XMaterial.SUNFLOWER.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.LILY_PAD);
|
INSTANT_BREAK.add(XMaterial.LILY_PAD.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.MELON_STEM);
|
INSTANT_BREAK.add(XMaterial.MELON_STEM.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.ATTACHED_MELON_STEM);
|
INSTANT_BREAK.add(XMaterial.ATTACHED_MELON_STEM.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.BROWN_MUSHROOM);
|
INSTANT_BREAK.add(XMaterial.BROWN_MUSHROOM.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.RED_MUSHROOM);
|
INSTANT_BREAK.add(XMaterial.RED_MUSHROOM.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.NETHER_WART);
|
INSTANT_BREAK.add(XMaterial.NETHER_WART.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.POTATOES);
|
INSTANT_BREAK.add(XMaterial.POTATOES.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.PUMPKIN_STEM);
|
INSTANT_BREAK.add(XMaterial.PUMPKIN_STEM.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.ATTACHED_PUMPKIN_STEM);
|
INSTANT_BREAK.add(XMaterial.ATTACHED_PUMPKIN_STEM.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.ACACIA_SAPLING);
|
INSTANT_BREAK.add(XMaterial.ACACIA_SAPLING.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.BIRCH_SAPLING);
|
INSTANT_BREAK.add(XMaterial.BIRCH_SAPLING.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.DARK_OAK_SAPLING);
|
INSTANT_BREAK.add(XMaterial.DARK_OAK_SAPLING.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.JUNGLE_SAPLING);
|
INSTANT_BREAK.add(XMaterial.JUNGLE_SAPLING.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.OAK_SAPLING);
|
INSTANT_BREAK.add(XMaterial.OAK_SAPLING.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.SPRUCE_SAPLING);
|
INSTANT_BREAK.add(XMaterial.SPRUCE_SAPLING.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.SUGAR_CANE);
|
INSTANT_BREAK.add(XMaterial.SUGAR_CANE.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.TALL_GRASS);
|
INSTANT_BREAK.add(XMaterial.TALL_GRASS.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.TALL_SEAGRASS);
|
INSTANT_BREAK.add(XMaterial.TALL_SEAGRASS.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.WHEAT);
|
INSTANT_BREAK.add(XMaterial.WHEAT.parseMaterial());
|
||||||
// Start 1.14 objects
|
// Start 1.14 objects
|
||||||
if (VersionUtil.isOfVersion("v1_14") || VersionUtil.isOfVersion("v1_15")
|
if (currentVersion.isAtLeast(MinecraftVersion.VILLAGE_UPDATE)) {
|
||||||
|| VersionUtil.isOfVersion("v1_16")) {
|
INSTANT_BREAK.add(XMaterial.BAMBOO_SAPLING.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.BAMBOO_SAPLING);
|
INSTANT_BREAK.add(XMaterial.CORNFLOWER.parseMaterial());
|
||||||
INSTANT_BREAK.add(Material.CORNFLOWER);
|
|
||||||
}
|
}
|
||||||
// End 1.14 objects
|
// End 1.14 objects
|
||||||
// Start 1.15 objects
|
// Start 1.15 objects
|
||||||
if (VersionUtil.isOfVersion("v1_15") || VersionUtil.isOfVersion("v1_16")) {
|
if (currentVersion.isAtLeast(MinecraftVersion.BEE_UPDATE)) {
|
||||||
INSTANT_BREAK.add(Material.HONEY_BLOCK);
|
INSTANT_BREAK.add(XMaterial.HONEY_BLOCK.parseMaterial());
|
||||||
}
|
}
|
||||||
// End 1.15 objects
|
// End 1.15 objects
|
||||||
// End instant break materials
|
// End instant break materials
|
||||||
|
|
||||||
// Start food
|
// Start food
|
||||||
FOOD.add(Material.APPLE);
|
FOOD.add(XMaterial.APPLE.parseMaterial());
|
||||||
FOOD.add(Material.BAKED_POTATO);
|
FOOD.add(XMaterial.BAKED_POTATO.parseMaterial());
|
||||||
FOOD.add(Material.BEETROOT);
|
FOOD.add(XMaterial.BEETROOT.parseMaterial());
|
||||||
FOOD.add(Material.BEETROOT_SOUP);
|
FOOD.add(XMaterial.BEETROOT_SOUP.parseMaterial());
|
||||||
FOOD.add(Material.BREAD);
|
FOOD.add(XMaterial.BREAD.parseMaterial());
|
||||||
FOOD.add(Material.CAKE);
|
FOOD.add(XMaterial.CAKE.parseMaterial());
|
||||||
FOOD.add(Material.CARROT);
|
FOOD.add(XMaterial.CARROT.parseMaterial());
|
||||||
FOOD.add(Material.CHORUS_FRUIT);
|
FOOD.add(XMaterial.CHORUS_FRUIT.parseMaterial());
|
||||||
FOOD.add(Material.COOKED_BEEF);
|
FOOD.add(XMaterial.COOKED_BEEF.parseMaterial());
|
||||||
FOOD.add(Material.COOKED_CHICKEN);
|
FOOD.add(XMaterial.COOKED_CHICKEN.parseMaterial());
|
||||||
FOOD.add(Material.COOKED_COD);
|
FOOD.add(XMaterial.COOKED_COD.parseMaterial());
|
||||||
FOOD.add(Material.COOKED_MUTTON);
|
FOOD.add(XMaterial.COOKED_MUTTON.parseMaterial());
|
||||||
FOOD.add(Material.COOKED_PORKCHOP);
|
FOOD.add(XMaterial.COOKED_PORKCHOP.parseMaterial());
|
||||||
FOOD.add(Material.COOKED_RABBIT);
|
FOOD.add(XMaterial.COOKED_RABBIT.parseMaterial());
|
||||||
FOOD.add(Material.COOKED_SALMON);
|
FOOD.add(XMaterial.COOKED_SALMON.parseMaterial());
|
||||||
FOOD.add(Material.COOKIE);
|
FOOD.add(XMaterial.COOKIE.parseMaterial());
|
||||||
FOOD.add(Material.DRIED_KELP);
|
FOOD.add(XMaterial.DRIED_KELP.parseMaterial());
|
||||||
FOOD.add(Material.ENCHANTED_GOLDEN_APPLE);
|
FOOD.add(XMaterial.ENCHANTED_GOLDEN_APPLE.parseMaterial());
|
||||||
FOOD.add(Material.GOLDEN_APPLE);
|
FOOD.add(XMaterial.GOLDEN_APPLE.parseMaterial());
|
||||||
FOOD.add(Material.GOLDEN_CARROT);
|
FOOD.add(XMaterial.GOLDEN_CARROT.parseMaterial());
|
||||||
FOOD.add(Material.MELON_SLICE);
|
FOOD.add(XMaterial.MELON_SLICE.parseMaterial());
|
||||||
FOOD.add(Material.MUSHROOM_STEW);
|
FOOD.add(XMaterial.MUSHROOM_STEW.parseMaterial());
|
||||||
FOOD.add(Material.POISONOUS_POTATO);
|
FOOD.add(XMaterial.POISONOUS_POTATO.parseMaterial());
|
||||||
FOOD.add(Material.POTATO);
|
FOOD.add(XMaterial.POTATO.parseMaterial());
|
||||||
FOOD.add(Material.PUFFERFISH);
|
FOOD.add(XMaterial.PUFFERFISH.parseMaterial());
|
||||||
FOOD.add(Material.PUMPKIN_PIE);
|
FOOD.add(XMaterial.PUMPKIN_PIE.parseMaterial());
|
||||||
FOOD.add(Material.RABBIT_STEW);
|
FOOD.add(XMaterial.RABBIT_STEW.parseMaterial());
|
||||||
FOOD.add(Material.BEEF);
|
FOOD.add(XMaterial.BEEF.parseMaterial());
|
||||||
FOOD.add(Material.CHICKEN);
|
FOOD.add(XMaterial.CHICKEN.parseMaterial());
|
||||||
FOOD.add(Material.COD);
|
FOOD.add(XMaterial.COD.parseMaterial());
|
||||||
FOOD.add(Material.MUTTON);
|
FOOD.add(XMaterial.MUTTON.parseMaterial());
|
||||||
FOOD.add(Material.PORKCHOP);
|
FOOD.add(XMaterial.PORKCHOP.parseMaterial());
|
||||||
FOOD.add(Material.RABBIT);
|
FOOD.add(XMaterial.RABBIT.parseMaterial());
|
||||||
FOOD.add(Material.SALMON);
|
FOOD.add(XMaterial.SALMON.parseMaterial());
|
||||||
FOOD.add(Material.ROTTEN_FLESH);
|
FOOD.add(XMaterial.ROTTEN_FLESH.parseMaterial());
|
||||||
FOOD.add(Material.SPIDER_EYE);
|
FOOD.add(XMaterial.SPIDER_EYE.parseMaterial());
|
||||||
FOOD.add(Material.TROPICAL_FISH);
|
FOOD.add(XMaterial.TROPICAL_FISH.parseMaterial());
|
||||||
// Start 1.14 objects
|
// Start 1.14 objects
|
||||||
if (VersionUtil.isOfVersion("v1_14") || VersionUtil.isOfVersion("v1_15")
|
if (currentVersion.isAtLeast(MinecraftVersion.VILLAGE_UPDATE)) {
|
||||||
|| VersionUtil.isOfVersion("v1_16")) {
|
FOOD.add(XMaterial.SUSPICIOUS_STEW.parseMaterial());
|
||||||
FOOD.add(Material.SUSPICIOUS_STEW);
|
FOOD.add(XMaterial.SWEET_BERRIES.parseMaterial());
|
||||||
FOOD.add(Material.SWEET_BERRIES);
|
|
||||||
}
|
}
|
||||||
// End 1.14 objects
|
// End 1.14 objects
|
||||||
// Start 1.15 objects
|
// Start 1.15 objects
|
||||||
if (VersionUtil.isOfVersion("v1_15") || VersionUtil.isOfVersion("v1_16")) {
|
if (currentVersion.isAtLeast(MinecraftVersion.BEE_UPDATE)) {
|
||||||
FOOD.add(Material.HONEY_BOTTLE);
|
FOOD.add(XMaterial.HONEY_BOTTLE.parseMaterial());
|
||||||
}
|
}
|
||||||
// End 1.15 objects
|
// End 1.15 objects
|
||||||
// End food
|
// End food
|
||||||
|
|
||||||
// Start combos
|
// Start combos
|
||||||
COMBO.put(Material.SHEARS, Material.BLACK_WOOL);
|
COMBO.put(XMaterial.SHEARS.parseMaterial(), XMaterial.BLACK_WOOL.parseMaterial());
|
||||||
COMBO.put(Material.SHEARS, Material.BLUE_WOOL);
|
COMBO.put(XMaterial.SHEARS.parseMaterial(), XMaterial.BLUE_WOOL.parseMaterial());
|
||||||
COMBO.put(Material.SHEARS, Material.BROWN_WOOL);
|
COMBO.put(XMaterial.SHEARS.parseMaterial(), XMaterial.BROWN_WOOL.parseMaterial());
|
||||||
COMBO.put(Material.SHEARS, Material.CYAN_WOOL);
|
COMBO.put(XMaterial.SHEARS.parseMaterial(), XMaterial.CYAN_WOOL.parseMaterial());
|
||||||
COMBO.put(Material.SHEARS, Material.GRAY_WOOL);
|
COMBO.put(XMaterial.SHEARS.parseMaterial(), XMaterial.GRAY_WOOL.parseMaterial());
|
||||||
COMBO.put(Material.SHEARS, Material.GREEN_WOOL);
|
COMBO.put(XMaterial.SHEARS.parseMaterial(), XMaterial.GREEN_WOOL.parseMaterial());
|
||||||
COMBO.put(Material.SHEARS, Material.LIGHT_BLUE_WOOL);
|
COMBO.put(XMaterial.SHEARS.parseMaterial(), XMaterial.LIGHT_BLUE_WOOL.parseMaterial());
|
||||||
COMBO.put(Material.SHEARS, Material.LIGHT_GRAY_WOOL);
|
COMBO.put(XMaterial.SHEARS.parseMaterial(), XMaterial.LIGHT_GRAY_WOOL.parseMaterial());
|
||||||
COMBO.put(Material.SHEARS, Material.LIME_WOOL);
|
COMBO.put(XMaterial.SHEARS.parseMaterial(), XMaterial.LIME_WOOL.parseMaterial());
|
||||||
COMBO.put(Material.SHEARS, Material.MAGENTA_WOOL);
|
COMBO.put(XMaterial.SHEARS.parseMaterial(), XMaterial.MAGENTA_WOOL.parseMaterial());
|
||||||
COMBO.put(Material.SHEARS, Material.MAGENTA_WOOL);
|
COMBO.put(XMaterial.SHEARS.parseMaterial(), XMaterial.MAGENTA_WOOL.parseMaterial());
|
||||||
COMBO.put(Material.SHEARS, Material.ORANGE_WOOL);
|
COMBO.put(XMaterial.SHEARS.parseMaterial(), XMaterial.ORANGE_WOOL.parseMaterial());
|
||||||
COMBO.put(Material.SHEARS, Material.PINK_WOOL);
|
COMBO.put(XMaterial.SHEARS.parseMaterial(), XMaterial.PINK_WOOL.parseMaterial());
|
||||||
COMBO.put(Material.SHEARS, Material.PURPLE_WOOL);
|
COMBO.put(XMaterial.SHEARS.parseMaterial(), XMaterial.PURPLE_WOOL.parseMaterial());
|
||||||
COMBO.put(Material.SHEARS, Material.RED_WOOL);
|
COMBO.put(XMaterial.SHEARS.parseMaterial(), XMaterial.RED_WOOL.parseMaterial());
|
||||||
COMBO.put(Material.SHEARS, Material.WHITE_WOOL);
|
COMBO.put(XMaterial.SHEARS.parseMaterial(), XMaterial.WHITE_WOOL.parseMaterial());
|
||||||
COMBO.put(Material.SHEARS, Material.YELLOW_WOOL);
|
COMBO.put(XMaterial.SHEARS.parseMaterial(), XMaterial.YELLOW_WOOL.parseMaterial());
|
||||||
|
|
||||||
COMBO.put(Material.IRON_SWORD, Material.COBWEB);
|
COMBO.put(XMaterial.IRON_SWORD.parseMaterial(), XMaterial.COBWEB.parseMaterial());
|
||||||
COMBO.put(Material.DIAMOND_SWORD, Material.COBWEB);
|
COMBO.put(XMaterial.DIAMOND_SWORD.parseMaterial(), XMaterial.COBWEB.parseMaterial());
|
||||||
COMBO.put(Material.STONE_SWORD, Material.COBWEB);
|
COMBO.put(XMaterial.STONE_SWORD.parseMaterial(), XMaterial.COBWEB.parseMaterial());
|
||||||
COMBO.put(Material.WOODEN_SWORD, Material.COBWEB);
|
COMBO.put(XMaterial.WOODEN_SWORD.parseMaterial(), XMaterial.COBWEB.parseMaterial());
|
||||||
// End combos
|
// End combos
|
||||||
|
|
||||||
// Start climbable
|
// Start climbable
|
||||||
CLIMBABLE.add(Material.VINE);
|
CLIMBABLE.add(XMaterial.VINE.parseMaterial());
|
||||||
CLIMBABLE.add(Material.LADDER);
|
CLIMBABLE.add(XMaterial.LADDER.parseMaterial());
|
||||||
CLIMBABLE.add(Material.WATER);
|
CLIMBABLE.add(XMaterial.WATER.parseMaterial());
|
||||||
// Start 1.14 objects
|
// Start 1.14 objects
|
||||||
if (VersionUtil.isOfVersion("v1_14") || VersionUtil.isOfVersion("v1_15")
|
if (currentVersion.isAtLeast(MinecraftVersion.VILLAGE_UPDATE)) {
|
||||||
|| VersionUtil.isOfVersion("v1_16")) {
|
CLIMBABLE.add(XMaterial.SCAFFOLDING.parseMaterial());
|
||||||
CLIMBABLE.add(Material.SCAFFOLDING);
|
CLIMBABLE.add(XMaterial.SWEET_BERRY_BUSH.parseMaterial());
|
||||||
CLIMBABLE.add(Material.SWEET_BERRY_BUSH);
|
|
||||||
}
|
}
|
||||||
// End 1.14 objects
|
// End 1.14 objects
|
||||||
|
|
||||||
// Start 1.16 objects
|
// Start 1.16 objects
|
||||||
if (VersionUtil.isOfVersion("v1_16")) {
|
if (currentVersion.isAtLeast(MinecraftVersion.NETHER_UPDATE)) {
|
||||||
CLIMBABLE.add(XMaterial.TWISTING_VINES.parseMaterial());
|
CLIMBABLE.add(XMaterial.TWISTING_VINES.parseMaterial());
|
||||||
CLIMBABLE.add(XMaterial.TWISTING_VINES_PLANT.parseMaterial());
|
CLIMBABLE.add(XMaterial.TWISTING_VINES_PLANT.parseMaterial());
|
||||||
CLIMBABLE.add(XMaterial.WEEPING_VINES.parseMaterial());
|
CLIMBABLE.add(XMaterial.WEEPING_VINES.parseMaterial());
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.rammelkast.anticheatreloaded.util;
|
package com.rammelkast.anticheatreloaded.util;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@@ -36,8 +35,8 @@ import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
|||||||
|
|
||||||
public class VersionUtil {
|
public class VersionUtil {
|
||||||
|
|
||||||
private static final List<String> SUPPORTED_VERSIONS = Arrays
|
public static final MinecraftVersion CURRENT_VERSION;
|
||||||
.asList(new String[] { "v1_16", "v1_15", "v1_14", "v1_13", "v1_8_R3" });
|
private static final List<String> SUPPORTED_VERSIONS;
|
||||||
|
|
||||||
public static String getVersion() {
|
public static String getVersion() {
|
||||||
return Bukkit.getServer().getClass().getPackage().getName().replace(".", ",").split(",")[3];
|
return Bukkit.getServer().getClass().getPackage().getName().replace(".", ",").split(",")[3];
|
||||||
@@ -74,15 +73,8 @@ public class VersionUtil {
|
|||||||
|| AntiCheatReloaded.getManager().getBackend().justLevitated(player);
|
|| AntiCheatReloaded.getManager().getBackend().justLevitated(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isRiptiding(Player player) {
|
|
||||||
if (isBountifulUpdate()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return player.isRiptiding();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean isSlowFalling(Player player) {
|
public static boolean isSlowFalling(Player player) {
|
||||||
if (isBountifulUpdate()) {
|
if (!CURRENT_VERSION.isAtLeast(MinecraftVersion.AQUATIC_UPDATE)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return player.hasPotionEffect(PotionEffectType.SLOW_FALLING);
|
return player.hasPotionEffect(PotionEffectType.SLOW_FALLING);
|
||||||
@@ -114,7 +106,7 @@ public class VersionUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Block getTargetBlock(Player player, int distance) {
|
public static Block getTargetBlock(Player player, int distance) {
|
||||||
if (isBountifulUpdate()) {
|
if (!CURRENT_VERSION.isAtLeast(MinecraftVersion.AQUATIC_UPDATE)) {
|
||||||
return player.getTargetBlock((Set<Material>) null, distance);
|
return player.getTargetBlock((Set<Material>) null, distance);
|
||||||
}
|
}
|
||||||
return player.getTargetBlockExact(distance);
|
return player.getTargetBlockExact(distance);
|
||||||
@@ -142,16 +134,21 @@ public class VersionUtil {
|
|||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player.hasPotionEffect(type))
|
if (player.hasPotionEffect(type))
|
||||||
return player.getPotionEffect(type).getAmplifier() + 1;
|
return player.getPotionEffect(type).getAmplifier() + 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isSwimming(Player player) {
|
public static boolean isSwimming(Player player) {
|
||||||
if (isBountifulUpdate()) {
|
if (!CURRENT_VERSION.isAtLeast(MinecraftVersion.AQUATIC_UPDATE)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return player.isSwimming();
|
return player.isSwimming();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static {
|
||||||
|
SUPPORTED_VERSIONS = Arrays.asList(new String[] { "v1_16", "v1_15", "v1_14", "v1_13", "v1_12", "v1_8_R3" });
|
||||||
|
CURRENT_VERSION = MinecraftVersion.getCurrentVersion();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -18,7 +18,7 @@ flight:
|
|||||||
accountForTpsDrops: 250
|
accountForTpsDrops: 250
|
||||||
# How many milliseconds to account for teleports
|
# How many milliseconds to account for teleports
|
||||||
# Increase this is you debug 'had too little Y dropoff' after teleports
|
# Increase this is you debug 'had too little Y dropoff' after teleports
|
||||||
accountForTeleports: 150
|
accountForTeleports: 400
|
||||||
# Checks for climbing behaviour in air
|
# Checks for climbing behaviour in air
|
||||||
# Debugs as 'tried to climb air'
|
# Debugs as 'tried to climb air'
|
||||||
airClimb:
|
airClimb:
|
||||||
@@ -26,7 +26,7 @@ flight:
|
|||||||
enabled: true
|
enabled: true
|
||||||
# How many milliseconds to account for teleports
|
# How many milliseconds to account for teleports
|
||||||
# Increase this is you debug 'tried to climb air' after teleports
|
# Increase this is you debug 'tried to climb air' after teleports
|
||||||
accountForTeleports: 50
|
accountForTeleports: 300
|
||||||
# Checks if a player is faking it's ground status to fly
|
# Checks if a player is faking it's ground status to fly
|
||||||
# Debugs as 'faked ground to fly'
|
# Debugs as 'faked ground to fly'
|
||||||
groundFlight:
|
groundFlight:
|
||||||
@@ -41,16 +41,14 @@ flight:
|
|||||||
maxOffset: 0.005
|
maxOffset: 0.005
|
||||||
# How many milliseconds to account for teleports
|
# How many milliseconds to account for teleports
|
||||||
# Increase this is you debug 'ignored gravity' after teleports
|
# Increase this is you debug 'ignored gravity' after teleports
|
||||||
accountForTeleports: 100
|
accountForTeleports: 300
|
||||||
# Amount of illegal moves before flagging
|
# Amount of illegal moves before flagging
|
||||||
vlBeforeFlag: 5
|
vlBeforeFlag: 5
|
||||||
|
|
||||||
# ElytraFly check settings
|
# ElytraFly check settings
|
||||||
# Checks for illegal upward elytra movement
|
# Checks for illegal upward elytra movement
|
||||||
elytrafly:
|
elytrafly:
|
||||||
# Should this check be enabled?
|
# Should this check be enabled?
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
# Speed check settings
|
# Speed check settings
|
||||||
# Checks if a player moves too fast
|
# Checks if a player moves too fast
|
||||||
speed:
|
speed:
|
||||||
@@ -63,7 +61,6 @@ speed:
|
|||||||
baseLimit: 0.03125
|
baseLimit: 0.03125
|
||||||
# Prediction multiplier for custom walk speeds
|
# Prediction multiplier for custom walk speeds
|
||||||
walkSpeedMultiplier: 1.4
|
walkSpeedMultiplier: 1.4
|
||||||
|
|
||||||
# Checks movement acceleration in the air
|
# Checks movement acceleration in the air
|
||||||
# Debugs as 'exceeded acceleration limits'
|
# Debugs as 'exceeded acceleration limits'
|
||||||
airAcceleration:
|
airAcceleration:
|
||||||
@@ -73,7 +70,6 @@ speed:
|
|||||||
baseLimit: 0.3725
|
baseLimit: 0.3725
|
||||||
# Limit multiplier for custom walk speeds
|
# Limit multiplier for custom walk speeds
|
||||||
walkSpeedMultiplier: 1.4
|
walkSpeedMultiplier: 1.4
|
||||||
|
|
||||||
# Checks movement acceleration in the air
|
# Checks movement acceleration in the air
|
||||||
# Debugs as 'had unexpected jumping behaviour'
|
# Debugs as 'had unexpected jumping behaviour'
|
||||||
jumpBehaviour:
|
jumpBehaviour:
|
||||||
@@ -81,7 +77,6 @@ speed:
|
|||||||
enabled: true
|
enabled: true
|
||||||
# Minimum movement distance needed to flag
|
# Minimum movement distance needed to flag
|
||||||
minimumDistXZ: 0.42
|
minimumDistXZ: 0.42
|
||||||
|
|
||||||
# Checks movement speed on the ground
|
# Checks movement speed on the ground
|
||||||
# Debugs as 'moved too fast on ground'
|
# Debugs as 'moved too fast on ground'
|
||||||
groundSpeed:
|
groundSpeed:
|
||||||
@@ -89,7 +84,6 @@ speed:
|
|||||||
enabled: true
|
enabled: true
|
||||||
# Initial speed limit value
|
# Initial speed limit value
|
||||||
initialLimit: 0.34
|
initialLimit: 0.34
|
||||||
|
|
||||||
# Checks movement acceleration in the air
|
# Checks movement acceleration in the air
|
||||||
# Debugs as 'exceeded vertical speed limit'
|
# Debugs as 'exceeded vertical speed limit'
|
||||||
verticalSpeed:
|
verticalSpeed:
|
||||||
@@ -97,19 +91,17 @@ speed:
|
|||||||
enabled: true
|
enabled: true
|
||||||
# Extra compensation when moving off a ladder up a slab
|
# Extra compensation when moving off a ladder up a slab
|
||||||
climbableCompensation: 0.04
|
climbableCompensation: 0.04
|
||||||
|
|
||||||
# Strafe check settings
|
# Strafe check settings
|
||||||
# Checks if a player switches movement angle in air
|
# Checks if a player switches movement angle in air
|
||||||
strafe:
|
strafe:
|
||||||
# Should this check be enabled?
|
# Should this check be enabled?
|
||||||
enabled: true
|
enabled: true
|
||||||
# How many milliseconds to account for teleports
|
# How many milliseconds to account for teleports
|
||||||
accountForTeleports: 100
|
accountForTeleports: 300
|
||||||
# Maximum angle change when moving in air
|
# Maximum angle change when moving in air
|
||||||
maxAngleChange: 0.50
|
maxAngleChange: 0.5
|
||||||
# Minimum movement distance for the strafe check to be active
|
# Minimum movement distance for the strafe check to be active
|
||||||
minActivationDistance: 0.025
|
minActivationDistance: 0.04
|
||||||
|
|
||||||
# WaterWalk check settings
|
# WaterWalk check settings
|
||||||
# Checks if a player is walking on water
|
# Checks if a player is walking on water
|
||||||
waterwalk:
|
waterwalk:
|
||||||
@@ -127,7 +119,7 @@ waterwalk:
|
|||||||
# Should this part of the check be enabled?
|
# Should this part of the check be enabled?
|
||||||
enabled: true
|
enabled: true
|
||||||
# Maximum lunge Y motion to flag
|
# Maximum lunge Y motion to flag
|
||||||
maxMotionY: 0.10
|
maxMotionY: 0.1
|
||||||
# Checks for small lunges in water
|
# Checks for small lunges in water
|
||||||
# Debugs as 'tried to lunge in water'
|
# Debugs as 'tried to lunge in water'
|
||||||
lunge:
|
lunge:
|
||||||
@@ -136,7 +128,6 @@ waterwalk:
|
|||||||
# Minimum xz distance before flagging
|
# Minimum xz distance before flagging
|
||||||
# This combats false positives, while giving hackers not much leniency
|
# This combats false positives, while giving hackers not much leniency
|
||||||
minimumDistXZ: 0.098
|
minimumDistXZ: 0.098
|
||||||
|
|
||||||
# FastLadder check settings
|
# FastLadder check settings
|
||||||
# Checks if a player moves too fast on a ladder
|
# Checks if a player moves too fast on a ladder
|
||||||
fastladder:
|
fastladder:
|
||||||
@@ -148,7 +139,6 @@ fastladder:
|
|||||||
speedDownMax: 0.15
|
speedDownMax: 0.15
|
||||||
# Amount of illegal ladder moves before flagging
|
# Amount of illegal ladder moves before flagging
|
||||||
vlBeforeFlag: 3
|
vlBeforeFlag: 3
|
||||||
|
|
||||||
# BoatFly check settings
|
# BoatFly check settings
|
||||||
# Checks if the player is flying in a boat
|
# Checks if the player is flying in a boat
|
||||||
boatfly:
|
boatfly:
|
||||||
@@ -156,7 +146,6 @@ boatfly:
|
|||||||
enabled: true
|
enabled: true
|
||||||
# Amount of in-boat airborne moments before flagging
|
# Amount of in-boat airborne moments before flagging
|
||||||
vlBeforeFlag: 2
|
vlBeforeFlag: 2
|
||||||
|
|
||||||
# KillAura check settings
|
# KillAura check settings
|
||||||
# Checks if the player uses a form of kill aura
|
# Checks if the player uses a form of kill aura
|
||||||
killaura:
|
killaura:
|
||||||
@@ -179,7 +168,6 @@ killaura:
|
|||||||
pingCompensation: 0.0025
|
pingCompensation: 0.0025
|
||||||
# The multiplier of extra compensation for velocity
|
# The multiplier of extra compensation for velocity
|
||||||
velocityMultiplier: 1.2
|
velocityMultiplier: 1.2
|
||||||
|
|
||||||
# Checks if the target it within a players viewing angle
|
# Checks if the target it within a players viewing angle
|
||||||
# Debugs as 'tried to attack from an illegal angle'
|
# Debugs as 'tried to attack from an illegal angle'
|
||||||
angle:
|
angle:
|
||||||
@@ -189,7 +177,6 @@ killaura:
|
|||||||
maxDifference: 50
|
maxDifference: 50
|
||||||
# Amount of illegally angled hits before flagging
|
# Amount of illegally angled hits before flagging
|
||||||
vlBeforeFlag: 3
|
vlBeforeFlag: 3
|
||||||
|
|
||||||
# Checks if the player has a suspicious packet order
|
# Checks if the player has a suspicious packet order
|
||||||
# Debugs as 'suspicious packet order'
|
# Debugs as 'suspicious packet order'
|
||||||
packetOrder:
|
packetOrder:
|
||||||
@@ -201,7 +188,6 @@ killaura:
|
|||||||
minElapsedTime: 5
|
minElapsedTime: 5
|
||||||
# Amount of suspicious combat packet situations before flagging
|
# Amount of suspicious combat packet situations before flagging
|
||||||
vlBeforeFlag: 3
|
vlBeforeFlag: 3
|
||||||
|
|
||||||
# Aimbot check settings
|
# Aimbot check settings
|
||||||
# Checks if the player is sending aimbot-like movements
|
# Checks if the player is sending aimbot-like movements
|
||||||
aimbot:
|
aimbot:
|
||||||
@@ -211,13 +197,11 @@ aimbot:
|
|||||||
minYaw: 30
|
minYaw: 30
|
||||||
# Maximum yaw difference when repeated
|
# Maximum yaw difference when repeated
|
||||||
maxYaw: 355
|
maxYaw: 355
|
||||||
|
|
||||||
# Criticals check settings
|
# Criticals check settings
|
||||||
# Checks if the player tries to do a crit without needed conditions
|
# Checks if the player tries to do a crit without needed conditions
|
||||||
criticals:
|
criticals:
|
||||||
# Should this check be enabled?
|
# Should this check be enabled?
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
# Velocity check settings
|
# Velocity check settings
|
||||||
# Checks if the player ignores knockback
|
# Checks if the player ignores knockback
|
||||||
velocity:
|
velocity:
|
||||||
@@ -227,7 +211,6 @@ velocity:
|
|||||||
minimumPercentage: 75
|
minimumPercentage: 75
|
||||||
# Amount of low-velocity moments before flagging
|
# Amount of low-velocity moments before flagging
|
||||||
vlBeforeFlag: 2
|
vlBeforeFlag: 2
|
||||||
|
|
||||||
# FastPlace check settings
|
# FastPlace check settings
|
||||||
# Checks if the player places blocks too fast
|
# Checks if the player places blocks too fast
|
||||||
fastplace:
|
fastplace:
|
||||||
@@ -236,12 +219,11 @@ fastplace:
|
|||||||
# Minimum time in milliseconds between block places
|
# Minimum time in milliseconds between block places
|
||||||
minimumTime: 50
|
minimumTime: 50
|
||||||
# Amount of fastplace-moments before flagging a survival player
|
# Amount of fastplace-moments before flagging a survival player
|
||||||
vlBeforeFlagSurvival: 2
|
vlBeforeFlagSurvival: 3
|
||||||
# Amount of fastplace-moments before flagging a creative player
|
# Amount of fastplace-moments before flagging a creative player
|
||||||
vlBeforeFlagCreative: 3
|
vlBeforeFlagCreative: 4
|
||||||
# Amount of time in milliseconds to prevent a player from placing blocks after flagging
|
# Amount of time in milliseconds to prevent a player from placing blocks after flagging
|
||||||
blockPlacementTime: 1000
|
blockPlacementTime: 1000
|
||||||
|
|
||||||
# IllegalInteract check settings
|
# IllegalInteract check settings
|
||||||
# Checks if the player is using, placing or breaking blocks from illegal angles
|
# Checks if the player is using, placing or breaking blocks from illegal angles
|
||||||
illegalinteract:
|
illegalinteract:
|
||||||
@@ -270,7 +252,6 @@ illegalinteract:
|
|||||||
pingCompensation: 0.0045
|
pingCompensation: 0.0045
|
||||||
# The multiplier of extra compensation for velocity
|
# The multiplier of extra compensation for velocity
|
||||||
velocityMultiplier: 1.5
|
velocityMultiplier: 1.5
|
||||||
|
|
||||||
# BadPackets check settings
|
# BadPackets check settings
|
||||||
# Checks for illegal packets
|
# Checks for illegal packets
|
||||||
badpackets:
|
badpackets:
|
||||||
@@ -280,7 +261,6 @@ badpackets:
|
|||||||
minimumTps: 17.5
|
minimumTps: 17.5
|
||||||
# Maximum distance a player can move between packets
|
# Maximum distance a player can move between packets
|
||||||
maxDistance: 25.0
|
maxDistance: 25.0
|
||||||
|
|
||||||
# MorePackets check settings
|
# MorePackets check settings
|
||||||
# Checks for an extra amount of packets and modified game timers
|
# Checks for an extra amount of packets and modified game timers
|
||||||
morepackets:
|
morepackets:
|
||||||
@@ -289,18 +269,17 @@ morepackets:
|
|||||||
# Minimum server TPS needed for MorePackets to be active
|
# Minimum server TPS needed for MorePackets to be active
|
||||||
minimumTps: 17.5
|
minimumTps: 17.5
|
||||||
# Maximum amount of lag compensation a player can acquire (50ms = 1 tick)
|
# Maximum amount of lag compensation a player can acquire (50ms = 1 tick)
|
||||||
minimumClamp: 500
|
minimumClamp: 1000
|
||||||
# The amount of milliseconds offset between packets before flagging (50ms = 1 tick)
|
# The amount of milliseconds offset between packets before flagging (50ms = 1 tick)
|
||||||
triggerBalance: 100
|
triggerBalance: 100
|
||||||
# The amount of milliseconds to compensate for a teleport (50ms = 1 tick)
|
# The amount of milliseconds to compensate for a teleport (50ms = 1 tick)
|
||||||
teleportCompensation: 150
|
teleportCompensation: 300
|
||||||
# Should MorePackets be disabled for 'lagging' players?
|
# Should MorePackets be disabled for 'lagging' players?
|
||||||
# This can easily be spoofed by clients!
|
# This can easily be spoofed by clients!
|
||||||
disableForLagging: false
|
disableForLagging: false
|
||||||
# Maximum ping value before MorePackets stops checking a player (-1 to disable)
|
# Maximum ping value before MorePackets stops checking a player (-1 to disable)
|
||||||
# This can easily be spoofed by clients!
|
# This can easily be spoofed by clients!
|
||||||
maxPing: -1
|
maxPing: -1
|
||||||
|
|
||||||
# Sneak check settings
|
# Sneak check settings
|
||||||
# Checks if the player toggles sneak too fast
|
# Checks if the player toggles sneak too fast
|
||||||
sneak:
|
sneak:
|
||||||
@@ -310,10 +289,9 @@ sneak:
|
|||||||
# This can easily be spoofed by clients!
|
# This can easily be spoofed by clients!
|
||||||
disableForLagging: false
|
disableForLagging: false
|
||||||
# Minimum server TPS needed for sneak
|
# Minimum server TPS needed for sneak
|
||||||
minimumTps: 12
|
minimumTps: 15
|
||||||
# Minimum time in milliseconds between sneak toggles
|
# Minimum time in milliseconds between sneak toggles
|
||||||
minToggleTime: 75
|
minToggleTime: 75
|
||||||
|
|
||||||
# NoSlow check settings
|
# NoSlow check settings
|
||||||
# Checks if the player moves too fast while blocking
|
# Checks if the player moves too fast while blocking
|
||||||
noslow:
|
noslow:
|
||||||
@@ -325,13 +303,11 @@ noslow:
|
|||||||
minimumDistXZ: 0.15
|
minimumDistXZ: 0.15
|
||||||
# Amount of no slowdown moments before flagging
|
# Amount of no slowdown moments before flagging
|
||||||
vlBeforeFlag: 3
|
vlBeforeFlag: 3
|
||||||
|
|
||||||
# Spider check settings
|
# Spider check settings
|
||||||
# Checks if the player tries to climb a non-climbable block
|
# Checks if the player tries to climb a non-climbable block
|
||||||
spider:
|
spider:
|
||||||
# Should this check be enabled?
|
# Should this check be enabled?
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
# NoFall check settings
|
# NoFall check settings
|
||||||
# Checks if the player tries to ignore fall damage
|
# Checks if the player tries to ignore fall damage
|
||||||
nofall:
|
nofall:
|
||||||
@@ -339,7 +315,6 @@ nofall:
|
|||||||
enabled: true
|
enabled: true
|
||||||
# Amount of moves with a modified fall distance before flagging
|
# Amount of moves with a modified fall distance before flagging
|
||||||
vlBeforeFlag: 6
|
vlBeforeFlag: 6
|
||||||
|
|
||||||
# Sprint check settings
|
# Sprint check settings
|
||||||
# Checks if the player tries to sprint without the needed conditions
|
# Checks if the player tries to sprint without the needed conditions
|
||||||
sprint:
|
sprint:
|
||||||
@@ -347,7 +322,6 @@ sprint:
|
|||||||
enabled: true
|
enabled: true
|
||||||
# Minimum food level needed to sprint
|
# Minimum food level needed to sprint
|
||||||
sprintFoodMin: 6
|
sprintFoodMin: 6
|
||||||
|
|
||||||
# FastBow check settings
|
# FastBow check settings
|
||||||
# Checks if the player fires a bow too fast
|
# Checks if the player fires a bow too fast
|
||||||
fastbow:
|
fastbow:
|
||||||
@@ -355,7 +329,6 @@ fastbow:
|
|||||||
enabled: true
|
enabled: true
|
||||||
# Maximum percent error between predicted bow force and actual bow force
|
# Maximum percent error between predicted bow force and actual bow force
|
||||||
bowError: 0.25
|
bowError: 0.25
|
||||||
|
|
||||||
# FastEat check settings
|
# FastEat check settings
|
||||||
# Checks if the player consumes food too fast
|
# Checks if the player consumes food too fast
|
||||||
fasteat:
|
fasteat:
|
||||||
@@ -363,7 +336,6 @@ fasteat:
|
|||||||
enabled: true
|
enabled: true
|
||||||
# Minimum time in milliseconds it takes to consume food
|
# Minimum time in milliseconds it takes to consume food
|
||||||
eatTimeMin: 1000
|
eatTimeMin: 1000
|
||||||
|
|
||||||
# FastHeal check settings
|
# FastHeal check settings
|
||||||
# Checks if the player regains health too fast
|
# Checks if the player regains health too fast
|
||||||
fastheal:
|
fastheal:
|
||||||
@@ -375,10 +347,10 @@ fastheal:
|
|||||||
# This can easily be spoofed by clients!
|
# This can easily be spoofed by clients!
|
||||||
disableForLagging: false
|
disableForLagging: false
|
||||||
# The minimum time it takes to regenerate health in milliseconds
|
# The minimum time it takes to regenerate health in milliseconds
|
||||||
minHealTime: 495
|
# Vanilla is 500, but enforcing this will cause too many false positives
|
||||||
|
minHealTime: 475
|
||||||
# Amount of milliseconds a player can heal faster per millisecond of ping
|
# Amount of milliseconds a player can heal faster per millisecond of ping
|
||||||
pingCompensation: 0.15
|
pingCompensation: 0.25
|
||||||
|
|
||||||
# FastProjectile check settings
|
# FastProjectile check settings
|
||||||
# Checks if the player fires a projectile too fast
|
# Checks if the player fires a projectile too fast
|
||||||
fastprojectile:
|
fastprojectile:
|
||||||
@@ -388,7 +360,6 @@ fastprojectile:
|
|||||||
projectilesToWait: 10
|
projectilesToWait: 10
|
||||||
# The minimum time in milliseconds it should have taken for the player fire 'projectilesToWait' projectiles
|
# The minimum time in milliseconds it should have taken for the player fire 'projectilesToWait' projectiles
|
||||||
minimumTime: 1500
|
minimumTime: 1500
|
||||||
|
|
||||||
# ItemSpam check settings
|
# ItemSpam check settings
|
||||||
# Checks if the player drops items too fast
|
# Checks if the player drops items too fast
|
||||||
itemspam:
|
itemspam:
|
||||||
@@ -398,7 +369,6 @@ itemspam:
|
|||||||
dropsToWait: 10
|
dropsToWait: 10
|
||||||
# The minimum time in milliseconds it should have taken for the player to drop items 'dropsToWait' times
|
# The minimum time in milliseconds it should have taken for the player to drop items 'dropsToWait' times
|
||||||
minimumTime: 800
|
minimumTime: 800
|
||||||
|
|
||||||
# FastInventory check settings
|
# FastInventory check settings
|
||||||
# Checks if the player moves items in the inventory too fast
|
# Checks if the player moves items in the inventory too fast
|
||||||
fastinventory:
|
fastinventory:
|
||||||
@@ -408,19 +378,16 @@ fastinventory:
|
|||||||
clicksToWait: 10
|
clicksToWait: 10
|
||||||
# The minimum time in milliseconds it should have taken for the player to click 'clicksToWait' times
|
# The minimum time in milliseconds it should have taken for the player to click 'clicksToWait' times
|
||||||
minimumTime: 50
|
minimumTime: 50
|
||||||
|
|
||||||
# vClip check settings
|
# vClip check settings
|
||||||
# Checks if the player is clipping
|
# Checks if the player is clipping
|
||||||
vclip:
|
vclip:
|
||||||
# Should this check be enabled?
|
# Should this check be enabled?
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
# ChatUnicode check settings
|
# ChatUnicode check settings
|
||||||
# Checks for illegal unicode characters in the chat
|
# Checks for illegal unicode characters in the chat
|
||||||
chatunicode:
|
chatunicode:
|
||||||
# Should this check be enabled?
|
# Should this check be enabled?
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
# ChatSpam check settings
|
# ChatSpam check settings
|
||||||
# Checks for a spam of chat messages
|
# Checks for a spam of chat messages
|
||||||
chatspam:
|
chatspam:
|
||||||
@@ -434,17 +401,16 @@ chatspam:
|
|||||||
levelActionOne: 5
|
levelActionOne: 5
|
||||||
# Number of chat spam violations before action two (see config.yml) is executed
|
# Number of chat spam violations before action two (see config.yml) is executed
|
||||||
levelActionTwo: 10
|
levelActionTwo: 10
|
||||||
|
|
||||||
# CommandSpam check settings
|
# CommandSpam check settings
|
||||||
# Checks for a spam of commands
|
# Checks for a spam of commands
|
||||||
commandspam:
|
commandspam:
|
||||||
# Should this check be enabled?
|
# Should this check be enabled?
|
||||||
enabled: true
|
enabled: true
|
||||||
# Minimum time between commands
|
# Minimum time between commands
|
||||||
timeMin: 400
|
timeMin: 250
|
||||||
# Time in milliseconds after which repeating a command is ignored
|
# Time in milliseconds after which repeating a command is ignored
|
||||||
repeatIgnore: 500
|
repeatIgnore: 500
|
||||||
# Number of command spam violations before action one (see config.yml) is executed
|
# Number of command spam violations before action one (see config.yml) is executed
|
||||||
levelActionOne: 5
|
levelActionOne: 5
|
||||||
# Number of command spam violations before action two (see config.yml) is executed
|
# Number of command spam violations before action two (see config.yml) is executed
|
||||||
levelActionTwo: 10
|
levelActionTwo: 10
|
||||||
Reference in new issue
Block a user