mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-01 14:38:56 +00:00
Respect speed for speed + potion; shade Updater. Fixes #259
This commit is contained in:
1 parent
d1804572aa
commit
870cebec59
5 files changed
+47
-7
No files matched your search
@@ -37,6 +37,26 @@
|
||||
<target>1.6</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>1.3</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<artifactSet>
|
||||
<includes>
|
||||
<include>net.gravitydevelopment.*</include>
|
||||
</includes>
|
||||
</artifactSet>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<finalName>AntiCheat</finalName>
|
||||
<extensions>
|
||||
@@ -90,6 +110,7 @@
|
||||
<groupId>net.gravitydevelopment.updater</groupId>
|
||||
<artifactId>updater</artifactId>
|
||||
<version>2.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<distributionManagement>
|
||||
|
||||
@@ -154,7 +154,7 @@ public class AntiCheat extends JavaPlugin {
|
||||
public void run() {
|
||||
verboseLog("Checking for a new update...");
|
||||
Updater updater = new Updater(plugin, PROJECT_ID, file, Updater.UpdateType.DEFAULT, false);
|
||||
update = updater.getResult() != Updater.UpdateResult.NO_UPDATE;
|
||||
update = updater.getResult() == Updater.UpdateResult.SUCCESS;
|
||||
verboseLog("Update available: " + update);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -311,6 +311,10 @@ public class Magic extends ConfigurationFile {
|
||||
* Maximum speed a player can travel forwards or backwards while under the influence; Type=double, +Leniency=Increase.
|
||||
*/
|
||||
public double XZ_SPEED_MAX_POTION;
|
||||
/**
|
||||
* Maximum speed a player can travel forwards or backwards while sprinting while under the influence; Type=double, +Leniency=Increase.
|
||||
*/
|
||||
public double XZ_SPEED_MAX_POTION_SPRINT;
|
||||
/**
|
||||
* Maximum speed a player can travel forwards or backwards while sneaking; Type=double, +Leniency=Increase.
|
||||
*/
|
||||
@@ -374,11 +378,11 @@ public class Magic extends ConfigurationFile {
|
||||
// 0.2 -> 0.3 diffs
|
||||
// Fix improperly stored double Y_MAXDIFF
|
||||
new ConfigValue<Double>("Y_MAXDIFF").setValue(new ConfigValue<Double>("Y_MAXDIFF").getDefaultValue());
|
||||
// Update version
|
||||
version = new ConfigValue<Double>("VERSION").setValue(0.3D);
|
||||
setNeedsReload(true);
|
||||
|
||||
}
|
||||
new ConfigValue<Double>("VERSION").setValue(new ConfigValue<Double>("VERSION").getDefaultValue());
|
||||
|
||||
ENTERED_EXITED_TIME = new ConfigValue<Integer>("ENTERED_EXITED_TIME").getValue();
|
||||
SNEAK_TIME = new ConfigValue<Integer>("SNEAK_TIME").getValue();
|
||||
TELEPORT_TIME = new ConfigValue<Integer>("TELEPORT_TIME").getValue();
|
||||
@@ -445,6 +449,7 @@ public class Magic extends ConfigurationFile {
|
||||
Y_TIME = new ConfigValue<Integer>("Y_TIME").getValue();
|
||||
XZ_SPEED_MAX = new ConfigValue<Double>("XZ_SPEED_MAX").getValue();
|
||||
XZ_SPEED_MAX_SPRINT = new ConfigValue<Double>("XZ_SPEED_MAX_SPRINT").getValue();
|
||||
XZ_SPEED_MAX_POTION_SPRINT = new ConfigValue<Double>("XZ_SPEED_MAX_POTION_SPRINT").getValue();
|
||||
XZ_SPEED_MAX_FLY = new ConfigValue<Double>("XZ_SPEED_MAX_FLY").getValue();
|
||||
XZ_SPEED_MAX_POTION = new ConfigValue<Double>("XZ_SPEED_MAX_POTION").getValue();
|
||||
XZ_SPEED_MAX_SNEAK = new ConfigValue<Double>("XZ_SPEED_MAX_SNEAK").getValue();
|
||||
|
||||
@@ -304,8 +304,13 @@ public class Backend {
|
||||
reason = "while flying ";
|
||||
max = magic.XZ_SPEED_MAX_FLY;
|
||||
} else if (player.hasPotionEffect(PotionEffectType.SPEED)) {
|
||||
reason = "with speed potion ";
|
||||
max = magic.XZ_SPEED_MAX_POTION;
|
||||
if (player.isSprinting()) {
|
||||
reason = "with speed potion while sprinting ";
|
||||
max = magic.XZ_SPEED_MAX_POTION_SPRINT;
|
||||
} else {
|
||||
reason = "with speed potion ";
|
||||
max = magic.XZ_SPEED_MAX_POTION;
|
||||
}
|
||||
} else if (player.isSprinting()) {
|
||||
reason = "while sprinting ";
|
||||
max = magic.XZ_SPEED_MAX_SPRINT;
|
||||
@@ -440,7 +445,7 @@ public class Backend {
|
||||
if (distance.getYDifference() > magic.TELEPORT_MIN || distance.getYDifference() < 0) {
|
||||
return PASS;
|
||||
}
|
||||
if (!isMovingExempt(player) && !Utilities.isClimbableBlock(player.getLocation().getBlock()) && !Utilities.isClimbableBlock(player.getLocation().add(0, -1, 0).getBlock()) && !player.isInsideVehicle() && !Utilities.isInWater(player)) {
|
||||
if (!isMovingExempt(player) && !Utilities.isClimbableBlock(player.getLocation().getBlock()) && !Utilities.isClimbableBlock(player.getLocation().add(0, -1, 0).getBlock()) && !player.isInsideVehicle() && !Utilities.isInWater(player) && !hasJumpPotion(player)) {
|
||||
double y1 = player.getLocation().getY();
|
||||
String name = player.getName();
|
||||
// Fix Y axis spam.
|
||||
@@ -1041,6 +1046,14 @@ public class Backend {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean hasJumpPotion(Player player) {
|
||||
return player.hasPotionEffect(PotionEffectType.JUMP);
|
||||
}
|
||||
|
||||
public boolean hasSpeedPotion(Player player) {
|
||||
return player.hasPotionEffect(PotionEffectType.SPEED);
|
||||
}
|
||||
|
||||
public void processChatSpammer(Player player) {
|
||||
User user = manager.getUserManager().getUser(player.getName());
|
||||
int level = chatLevel.containsKey(user.getName()) ? chatLevel.get(user.getName()) : 0;
|
||||
|
||||
@@ -71,6 +71,7 @@ WATER_SPEED_VIOLATION_MAX: 4
|
||||
XZ_SPEED_MAX: 0.25
|
||||
XZ_SPEED_MAX_FLY: 0.56
|
||||
XZ_SPEED_MAX_POTION: 0.7
|
||||
XZ_SPEED_MAX_POTION_SPRINT: 0.95
|
||||
XZ_SPEED_MAX_SNEAK: 0.15
|
||||
XZ_SPEED_MAX_SOULSAND: 0.13
|
||||
XZ_SPEED_MAX_SOULSAND_POTION: 0.16
|
||||
@@ -83,4 +84,4 @@ Y_MAXVIOLATIONS: 1
|
||||
Y_MAXVIOTIME: 5000
|
||||
Y_SPEED_MAX: 0.5
|
||||
Y_TIME: 1000
|
||||
VERSION: 0.4
|
||||
VERSION: 0.5
|
||||
Reference in new issue
Block a user