mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-03 06:28:52 +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>
|
<target>1.6</target>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</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>
|
</plugins>
|
||||||
<finalName>AntiCheat</finalName>
|
<finalName>AntiCheat</finalName>
|
||||||
<extensions>
|
<extensions>
|
||||||
@@ -90,6 +110,7 @@
|
|||||||
<groupId>net.gravitydevelopment.updater</groupId>
|
<groupId>net.gravitydevelopment.updater</groupId>
|
||||||
<artifactId>updater</artifactId>
|
<artifactId>updater</artifactId>
|
||||||
<version>2.1</version>
|
<version>2.1</version>
|
||||||
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<distributionManagement>
|
<distributionManagement>
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ public class AntiCheat extends JavaPlugin {
|
|||||||
public void run() {
|
public void run() {
|
||||||
verboseLog("Checking for a new update...");
|
verboseLog("Checking for a new update...");
|
||||||
Updater updater = new Updater(plugin, PROJECT_ID, file, Updater.UpdateType.DEFAULT, false);
|
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);
|
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.
|
* Maximum speed a player can travel forwards or backwards while under the influence; Type=double, +Leniency=Increase.
|
||||||
*/
|
*/
|
||||||
public double XZ_SPEED_MAX_POTION;
|
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.
|
* 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
|
// 0.2 -> 0.3 diffs
|
||||||
// Fix improperly stored double Y_MAXDIFF
|
// Fix improperly stored double Y_MAXDIFF
|
||||||
new ConfigValue<Double>("Y_MAXDIFF").setValue(new ConfigValue<Double>("Y_MAXDIFF").getDefaultValue());
|
new ConfigValue<Double>("Y_MAXDIFF").setValue(new ConfigValue<Double>("Y_MAXDIFF").getDefaultValue());
|
||||||
// Update version
|
|
||||||
version = new ConfigValue<Double>("VERSION").setValue(0.3D);
|
|
||||||
setNeedsReload(true);
|
setNeedsReload(true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
new ConfigValue<Double>("VERSION").setValue(new ConfigValue<Double>("VERSION").getDefaultValue());
|
||||||
|
|
||||||
ENTERED_EXITED_TIME = new ConfigValue<Integer>("ENTERED_EXITED_TIME").getValue();
|
ENTERED_EXITED_TIME = new ConfigValue<Integer>("ENTERED_EXITED_TIME").getValue();
|
||||||
SNEAK_TIME = new ConfigValue<Integer>("SNEAK_TIME").getValue();
|
SNEAK_TIME = new ConfigValue<Integer>("SNEAK_TIME").getValue();
|
||||||
TELEPORT_TIME = new ConfigValue<Integer>("TELEPORT_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();
|
Y_TIME = new ConfigValue<Integer>("Y_TIME").getValue();
|
||||||
XZ_SPEED_MAX = new ConfigValue<Double>("XZ_SPEED_MAX").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_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_FLY = new ConfigValue<Double>("XZ_SPEED_MAX_FLY").getValue();
|
||||||
XZ_SPEED_MAX_POTION = new ConfigValue<Double>("XZ_SPEED_MAX_POTION").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();
|
XZ_SPEED_MAX_SNEAK = new ConfigValue<Double>("XZ_SPEED_MAX_SNEAK").getValue();
|
||||||
|
|||||||
@@ -304,8 +304,13 @@ public class Backend {
|
|||||||
reason = "while flying ";
|
reason = "while flying ";
|
||||||
max = magic.XZ_SPEED_MAX_FLY;
|
max = magic.XZ_SPEED_MAX_FLY;
|
||||||
} else if (player.hasPotionEffect(PotionEffectType.SPEED)) {
|
} else if (player.hasPotionEffect(PotionEffectType.SPEED)) {
|
||||||
reason = "with speed potion ";
|
if (player.isSprinting()) {
|
||||||
max = magic.XZ_SPEED_MAX_POTION;
|
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()) {
|
} else if (player.isSprinting()) {
|
||||||
reason = "while sprinting ";
|
reason = "while sprinting ";
|
||||||
max = magic.XZ_SPEED_MAX_SPRINT;
|
max = magic.XZ_SPEED_MAX_SPRINT;
|
||||||
@@ -440,7 +445,7 @@ public class Backend {
|
|||||||
if (distance.getYDifference() > magic.TELEPORT_MIN || distance.getYDifference() < 0) {
|
if (distance.getYDifference() > magic.TELEPORT_MIN || distance.getYDifference() < 0) {
|
||||||
return PASS;
|
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();
|
double y1 = player.getLocation().getY();
|
||||||
String name = player.getName();
|
String name = player.getName();
|
||||||
// Fix Y axis spam.
|
// 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) {
|
public void processChatSpammer(Player player) {
|
||||||
User user = manager.getUserManager().getUser(player.getName());
|
User user = manager.getUserManager().getUser(player.getName());
|
||||||
int level = chatLevel.containsKey(user.getName()) ? chatLevel.get(user.getName()) : 0;
|
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: 0.25
|
||||||
XZ_SPEED_MAX_FLY: 0.56
|
XZ_SPEED_MAX_FLY: 0.56
|
||||||
XZ_SPEED_MAX_POTION: 0.7
|
XZ_SPEED_MAX_POTION: 0.7
|
||||||
|
XZ_SPEED_MAX_POTION_SPRINT: 0.95
|
||||||
XZ_SPEED_MAX_SNEAK: 0.15
|
XZ_SPEED_MAX_SNEAK: 0.15
|
||||||
XZ_SPEED_MAX_SOULSAND: 0.13
|
XZ_SPEED_MAX_SOULSAND: 0.13
|
||||||
XZ_SPEED_MAX_SOULSAND_POTION: 0.16
|
XZ_SPEED_MAX_SOULSAND_POTION: 0.16
|
||||||
@@ -83,4 +84,4 @@ Y_MAXVIOLATIONS: 1
|
|||||||
Y_MAXVIOTIME: 5000
|
Y_MAXVIOTIME: 5000
|
||||||
Y_SPEED_MAX: 0.5
|
Y_SPEED_MAX: 0.5
|
||||||
Y_TIME: 1000
|
Y_TIME: 1000
|
||||||
VERSION: 0.4
|
VERSION: 0.5
|
||||||
Reference in new issue
Block a user