Yatopia/patches/server/0048-Configurable-flight-checks.patch

45 lines
2.7 KiB
Diff
Raw Normal View History

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2020-11-08 18:11:25 +01:00
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
Updated Upstream and Sidestream(s) (Tuinity/EMC/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: de6c239 Merge branch 'master' of https://github.com/Spottedleaf/Tuinity into ver/1.16.4 cc34294 Copy passenger list in enderTeleportTo 8c5d945 Improve abnormal server shutdown process 0ae7e67 Do not load chunks during a crash report 0fbcf78 Fix small issue with handling of step height in colliding 4722d59 Updated Upstream (Paper) EMC Changes: 1d0cc885 Updated Paper Purpur Changes: 3776636 Implement TPSBar 258ae07 Updated Upstream (Paper) c51e391 Add back --zero-commit ef0b93d Rebuild patches 0ae637c Option for chests to open even with a solid block on top ce4ab83 Phantom flames on swoop 5e2d697 Don't apply potion effects on load either bbe5a58 Don't apply potion effect to wolves during worldgen 06c4f83 Get max health attribute even closer to vanilla 41f23a7 Updated Upstream (Tuinity) 787e35c Get max health equations for horse types closer to vanilla aed0867 Fix CraftSound backwards compatibility dfabf51 Start of the configurable base attributes a1fa221 Updated Upstream (Paper) 0174fcd Configurable default wolf collar color (#116) da48e0a [ci-skip] fix comment in last patch 65fde28 Add option for using milk to cure wolves 38efb4d Use a ThreadLocal SimpleDateFormat for CriterionProgress deserialization 4e6e1ff Revert "Fix concurrency issue with CriterionProgress deserialization" 55bde37 Fix concurrency issue with CriterionProgress deserialization b4be9ab Small fixes to rabid wolves patch 5943978 Updated Upstream (Paper) ac34692 Chance to spawn wolves as "rabid" (#114) 1b40f87 Updated Upstream (Paper) 69790ff Alphabetize in-game /plugins list AirplaneLite Changes: 76810f1 Updated Upstream (Tuinity)
2020-12-13 16:18:57 +01:00
index 3c6ad3d5802f66d60e0087a16aedcd12254da420..3c68815c80b8f40d1b07bad080b3059c649b0b0e 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
Updated Upstream and Sidestream(s) (Tuinity/EMC/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: de6c239 Merge branch 'master' of https://github.com/Spottedleaf/Tuinity into ver/1.16.4 cc34294 Copy passenger list in enderTeleportTo 8c5d945 Improve abnormal server shutdown process 0ae7e67 Do not load chunks during a crash report 0fbcf78 Fix small issue with handling of step height in colliding 4722d59 Updated Upstream (Paper) EMC Changes: 1d0cc885 Updated Paper Purpur Changes: 3776636 Implement TPSBar 258ae07 Updated Upstream (Paper) c51e391 Add back --zero-commit ef0b93d Rebuild patches 0ae637c Option for chests to open even with a solid block on top ce4ab83 Phantom flames on swoop 5e2d697 Don't apply potion effects on load either bbe5a58 Don't apply potion effect to wolves during worldgen 06c4f83 Get max health attribute even closer to vanilla 41f23a7 Updated Upstream (Tuinity) 787e35c Get max health equations for horse types closer to vanilla aed0867 Fix CraftSound backwards compatibility dfabf51 Start of the configurable base attributes a1fa221 Updated Upstream (Paper) 0174fcd Configurable default wolf collar color (#116) da48e0a [ci-skip] fix comment in last patch 65fde28 Add option for using milk to cure wolves 38efb4d Use a ThreadLocal SimpleDateFormat for CriterionProgress deserialization 4e6e1ff Revert "Fix concurrency issue with CriterionProgress deserialization" 55bde37 Fix concurrency issue with CriterionProgress deserialization b4be9ab Small fixes to rabid wolves patch 5943978 Updated Upstream (Paper) ac34692 Chance to spawn wolves as "rabid" (#114) 1b40f87 Updated Upstream (Paper) 69790ff Alphabetize in-game /plugins list AirplaneLite Changes: 76810f1 Updated Upstream (Tuinity)
2020-12-13 16:18:57 +01:00
@@ -175,7 +175,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;
Updated Upstream and Sidestream(s) (Tuinity/EMC/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: de6c239 Merge branch 'master' of https://github.com/Spottedleaf/Tuinity into ver/1.16.4 cc34294 Copy passenger list in enderTeleportTo 8c5d945 Improve abnormal server shutdown process 0ae7e67 Do not load chunks during a crash report 0fbcf78 Fix small issue with handling of step height in colliding 4722d59 Updated Upstream (Paper) EMC Changes: 1d0cc885 Updated Paper Purpur Changes: 3776636 Implement TPSBar 258ae07 Updated Upstream (Paper) c51e391 Add back --zero-commit ef0b93d Rebuild patches 0ae637c Option for chests to open even with a solid block on top ce4ab83 Phantom flames on swoop 5e2d697 Don't apply potion effects on load either bbe5a58 Don't apply potion effect to wolves during worldgen 06c4f83 Get max health attribute even closer to vanilla 41f23a7 Updated Upstream (Tuinity) 787e35c Get max health equations for horse types closer to vanilla aed0867 Fix CraftSound backwards compatibility dfabf51 Start of the configurable base attributes a1fa221 Updated Upstream (Paper) 0174fcd Configurable default wolf collar color (#116) da48e0a [ci-skip] fix comment in last patch 65fde28 Add option for using milk to cure wolves 38efb4d Use a ThreadLocal SimpleDateFormat for CriterionProgress deserialization 4e6e1ff Revert "Fix concurrency issue with CriterionProgress deserialization" 55bde37 Fix concurrency issue with CriterionProgress deserialization b4be9ab Small fixes to rabid wolves patch 5943978 Updated Upstream (Paper) ac34692 Chance to spawn wolves as "rabid" (#114) 1b40f87 Updated Upstream (Paper) 69790ff Alphabetize in-game /plugins list AirplaneLite Changes: 76810f1 Updated Upstream (Tuinity)
2020-12-13 16:18:57 +01:00
@@ -194,7 +194,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);
+ }
}