2020-09-30 17:35:35 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2020-09-30 18:19:16 +02:00
|
|
|
From: epserv <admin@epserv.ru>
|
2020-09-30 17:35:35 +02:00
|
|
|
Date: Wed, 30 Sep 2020 18:20:12 +0300
|
|
|
|
Subject: [PATCH] Configurable flight checks
|
|
|
|
|
2020-09-30 18:19:16 +02:00
|
|
|
|
2020-09-30 17:35:35 +02:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
2020-11-07 08:02:33 +01:00
|
|
|
index f7afa92333ab173446edafd93eb4845829425b40..3a022aa9be7778ba26f005a1c9b926c5f311c525 100644
|
2020-09-30 17:35:35 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
2020-11-07 08:02:33 +01:00
|
|
|
@@ -177,7 +177,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
2020-09-30 17:35:35 +02:00
|
|
|
++this.e;
|
|
|
|
this.processedMovePackets = this.receivedMovePackets;
|
|
|
|
if (this.B && !this.player.isSleeping()) {
|
|
|
|
- if (++this.C > 80) {
|
|
|
|
+ if (net.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;
|
2020-11-07 08:02:33 +01:00
|
|
|
@@ -196,7 +196,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
2020-09-30 17:35:35 +02:00
|
|
|
this.w = this.r.locY();
|
|
|
|
this.x = this.r.locZ();
|
|
|
|
if (this.D && this.player.getRootVehicle().getRidingPassenger() == this.player) {
|
|
|
|
- if (++this.E > 80) {
|
|
|
|
+ if (net.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/net/yatopia/server/YatopiaConfig.java b/src/main/java/net/yatopia/server/YatopiaConfig.java
|
|
|
|
index e4c5a485caa9e97388aefd9dc5a3ce40efeca738..f0e7684304cab9cea05fa266a66a2ad8172c55b6 100644
|
|
|
|
--- a/src/main/java/net/yatopia/server/YatopiaConfig.java
|
|
|
|
+++ b/src/main/java/net/yatopia/server/YatopiaConfig.java
|
|
|
|
@@ -246,4 +246,11 @@ public class YatopiaConfig {
|
|
|
|
public static boolean isProxy() {
|
|
|
|
return org.spigotmc.SpigotConfig.bungee || com.destroystokyo.paper.PaperConfig.velocitySupport;
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ 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);
|
|
|
|
+ }
|
|
|
|
}
|