mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-02 22:16:03 +00:00
Fixed Elytra issues for 1_9_R1, still not able to find .isGliding() in
R2?
This commit is contained in:
1 parent
fcc75800d2
commit
6fa3f4c8df
3 files changed
+29
-2
No files matched your search
@@ -64,6 +64,7 @@ import net.gravitydevelopment.anticheat.util.Distance;
|
|||||||
import net.gravitydevelopment.anticheat.util.Permission;
|
import net.gravitydevelopment.anticheat.util.Permission;
|
||||||
import net.gravitydevelopment.anticheat.util.User;
|
import net.gravitydevelopment.anticheat.util.User;
|
||||||
import net.gravitydevelopment.anticheat.util.Utilities;
|
import net.gravitydevelopment.anticheat.util.Utilities;
|
||||||
|
import net.gravitydevelopment.anticheat.util.VersionUtil;
|
||||||
|
|
||||||
public class PlayerListener extends EventListener {
|
public class PlayerListener extends EventListener {
|
||||||
|
|
||||||
@@ -332,7 +333,7 @@ public class PlayerListener extends EventListener {
|
|||||||
log(result.getMessage(), player, CheckType.SPRINT);
|
log(result.getMessage(), player, CheckType.SPRINT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (getCheckManager().willCheckQuick(player, CheckType.FLY) && !player.isFlying()) /*TODO: ElytraFly fix */ {
|
if (getCheckManager().willCheckQuick(player, CheckType.FLY) && !VersionUtil.isFlying(player)) {
|
||||||
CheckResult result = FlightCheck.runCheck(player, distance);
|
CheckResult result = FlightCheck.runCheck(player, distance);
|
||||||
if (result.failed()) {
|
if (result.failed()) {
|
||||||
if (!silentMode()) {
|
if (!silentMode()) {
|
||||||
@@ -341,7 +342,7 @@ public class PlayerListener extends EventListener {
|
|||||||
log(result.getMessage(), player, CheckType.FLY);
|
log(result.getMessage(), player, CheckType.FLY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (getCheckManager().willCheckQuick(player, CheckType.FLY) && !player.isFlying())/*TODO: ElytraFly fix */ {
|
if (getCheckManager().willCheckQuick(player, CheckType.FLY) && !VersionUtil.isFlying(player)) {
|
||||||
CheckResult result = GlideCheck.runCheck(player, distance);
|
CheckResult result = GlideCheck.runCheck(player, distance);
|
||||||
if (result.failed()) {
|
if (result.failed()) {
|
||||||
// NO TELEPORT NEEDED HERE, HANDLED BY CHECK ITSELF
|
// NO TELEPORT NEEDED HERE, HANDLED BY CHECK ITSELF
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package net.gravitydevelopment.anticheat.util;
|
||||||
|
|
||||||
|
import org.bukkit.craftbukkit.v1_9_R1.entity.CraftPlayer;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import net.minecraft.server.v1_9_R1.EntityPlayer;
|
||||||
|
|
||||||
|
public class ElytraUtil_R1 {
|
||||||
|
|
||||||
|
public static boolean isGliding(Player p) {
|
||||||
|
EntityPlayer player = ((CraftPlayer)p).getHandle();
|
||||||
|
return player.cB();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package net.gravitydevelopment.anticheat.util;
|
package net.gravitydevelopment.anticheat.util;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
public class VersionUtil {
|
public class VersionUtil {
|
||||||
|
|
||||||
@@ -12,4 +13,14 @@ public class VersionUtil {
|
|||||||
return version;
|
return version;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isFlying(Player p) {
|
||||||
|
if (getVersion().equals("v1_8_R3")) {
|
||||||
|
return p.isFlying();
|
||||||
|
}else if (getVersion().equals("v1_9_R1")) {
|
||||||
|
return p.isFlying() || ElytraUtil_R1.isGliding(p);
|
||||||
|
}else {
|
||||||
|
return p.isFlying();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user