2020-09-30 17:35:35 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2020-11-08 18:11:25 +01:00
|
|
|
From: l_MrBoom_l <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
|
2021-01-25 20:22:51 +01:00
|
|
|
index aed9a2d151dad500e30d1871e059adec712fa450..2d10a3b5aa073ebc7e51beb428f707d6fbfc3001 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-12-17 08:48:17 +01:00
|
|
|
@@ -179,7 +179,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) {
|
2020-12-02 07:35:11 +01:00
|
|
|
+ if (org.yatopiamc.yatopia.server.YatopiaConfig.checkFlying && ++this.C > 80) { // Yatopia
|
2020-09-30 17:35:35 +02:00
|
|
|
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-12-17 08:48:17 +01:00
|
|
|
@@ -198,7 +198,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) {
|
2020-12-02 07:35:11 +01:00
|
|
|
+ if (org.yatopiamc.yatopia.server.YatopiaConfig.checkVehicleFlying && ++this.E > 80) { // Yatopia
|
2020-09-30 17:35:35 +02:00
|
|
|
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;
|
2020-12-02 07:35:11 +01:00
|
|
|
diff --git a/src/main/java/org/yatopiamc/yatopia/server/YatopiaConfig.java b/src/main/java/org/yatopiamc/yatopia/server/YatopiaConfig.java
|
2021-01-24 16:52:19 +01:00
|
|
|
index f6a8f3c4e92455eff806978d503751b6723ea858..81ab5afa7bd397266d2afe77426d2e629529aa1a 100644
|
2020-12-02 07:35:11 +01:00
|
|
|
--- a/src/main/java/org/yatopiamc/yatopia/server/YatopiaConfig.java
|
|
|
|
+++ b/src/main/java/org/yatopiamc/yatopia/server/YatopiaConfig.java
|
2021-01-24 16:52:19 +01:00
|
|
|
@@ -223,4 +223,11 @@ public class YatopiaConfig {
|
|
|
|
private static void fixFallDistance() {
|
|
|
|
fixFallDistance = getBoolean("settings.fixFallDistance", false);
|
2020-09-30 17:35:35 +02:00
|
|
|
}
|
|
|
|
+
|
|
|
|
+ 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);
|
|
|
|
+ }
|
|
|
|
}
|