Yatopia/patches/server/0046-Configurable-flight-checks.patch
Ivan Pekov 0c43fe2949
Updated Upstream and Sidestream(s) (Tuinity/EMC/Origami/Purpur/AirplaneLite)
Upstream/An Sidestream has released updates that appears to apply and compile correctly
This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing.

Tuinity Changes:
c04b005 Merge branch 'master' of https://github.com/Spottedleaf/Tuinity into ver/1.16.5
1d169e7 Updated Upstream (Paper)

EMC Changes:
a8914cb8 Remove the ProjectileHitBlockEvent
b8f864b5 Updated Paper
42cd3269 Remove FlowerPotPlantEvent and undeprecate FlowerPotRemoveEvent
64b3edf0 Remove the UUID key for setSpawnedEntity
938c6f1b Convert spawn egg entity tag attributes on creature spawn
4cc80284 Disable entityTag conversion since data version isn't accessible in scope
478d83fe Updated Paper
1e409abf Updated Paper

Origami Changes:
ab42df9 Update Paper

Purpur Changes:
7e8bf66 Updated Upstream (Paper & Tuinity)

AirplaneLite Changes:
3200f2a Add new webhook for notifications
fe01371 Up MC version
c585ff5 Updated Upstream (Tuinity)
2021-01-18 18:40:21 +02:00

45 lines
2.7 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: l_MrBoom_l <admin@epserv.ru>
Date: Wed, 30 Sep 2020 18:20:12 +0300
Subject: [PATCH] Configurable flight checks
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 63bceb9f1695ce4db5b932ca627d944506b03c0d..4e343bf4865655020994c40a1c7101afb994a659 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -179,7 +179,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;
@@ -198,7 +198,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 b358aacce7b8e1282d721ae1077b888239ec6b39..26bd1fc5b348cc16ca29f66eead2ca42bd4258a8 100644
--- a/src/main/java/org/yatopiamc/yatopia/server/YatopiaConfig.java
+++ b/src/main/java/org/yatopiamc/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);
+ }
}