From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: l_MrBoom_l Date: Wed, 30 Sep 2020 18:20:12 +0300 Subject: [PATCH] Configurable flight checks diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java index bdf56b18e3cbd3e7c9925586fbc35ffd8992dbb2..b5c1e7aa4da9028840acb4295aa53fa7e39a4179 100644 --- a/src/main/java/net/minecraft/server/network/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java @@ -328,7 +328,7 @@ public class PlayerConnection implements PacketListenerPlayIn { ++this.e; this.processedMovePackets = this.receivedMovePackets; if (this.B && !this.player.isSleeping()) { - if (++this.C > 80) { + if (org.yatopiamc.yatopia.server.YatopiaConfig.checkFlying && ++this.C > 80) { // Yatopia PlayerConnection.LOGGER.warn("{} was kicked for floating too long!", this.player.getDisplayName().getString()); this.disconnect(com.destroystokyo.paper.PaperConfig.flyingKickPlayerMessage); // Paper - use configurable kick message return; @@ -347,7 +347,7 @@ public class PlayerConnection implements PacketListenerPlayIn { this.w = this.r.locY(); this.x = this.r.locZ(); if (this.D && this.player.getRootVehicle().getRidingPassenger() == this.player) { - if (++this.E > 80) { + if (org.yatopiamc.yatopia.server.YatopiaConfig.checkVehicleFlying && ++this.E > 80) { // Yatopia PlayerConnection.LOGGER.warn("{} was kicked for floating a vehicle too long!", this.player.getDisplayName().getString()); this.disconnect(com.destroystokyo.paper.PaperConfig.flyingKickVehicleMessage); // Paper - use configurable kick message return; diff --git a/src/main/java/org/yatopiamc/yatopia/server/YatopiaConfig.java b/src/main/java/org/yatopiamc/yatopia/server/YatopiaConfig.java index f2058af295169449372fbe59e26795291509fa69..241d11017e354f4b23d004b5cfa2283bede7d58c 100644 --- a/src/main/java/org/yatopiamc/yatopia/server/YatopiaConfig.java +++ b/src/main/java/org/yatopiamc/yatopia/server/YatopiaConfig.java @@ -248,4 +248,11 @@ public class YatopiaConfig { private static void fixFallDistance() { fixFallDistance = getBoolean("settings.fixFallDistance", false); } + + public static boolean checkFlying = true; + public static boolean checkVehicleFlying = true; + private static void flightChecks() { + checkFlying = getBoolean("settings.checks.flight", checkFlying); + checkVehicleFlying = getBoolean("settings.checks.vehicle-flight", checkVehicleFlying); + } }