2021-06-11 14:02:28 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: kashike <kashike@vq.lc>
|
|
|
|
Date: Tue, 20 Sep 2016 00:58:01 +0000
|
|
|
|
Subject: [PATCH] Configurable flying kick messages
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
2022-03-11 21:13:46 +01:00
|
|
|
index 081761cd2177bd3cea5a489a85e7088c46d12725..6f36c7a233ec0335d713523e87a28ba9b5e46d88 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
2021-11-09 08:59:15 +01:00
|
|
|
@@ -273,4 +273,11 @@ public class PaperConfig {
|
2021-06-11 14:02:28 +02:00
|
|
|
}
|
|
|
|
packetInSpamThreshold = getInt("settings.incoming-packet-spam-threshold", 300);
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ public static String flyingKickPlayerMessage = "Flying is not enabled on this server";
|
|
|
|
+ public static String flyingKickVehicleMessage = "Flying is not enabled on this server";
|
|
|
|
+ private static void flyingKickMessages() {
|
|
|
|
+ flyingKickPlayerMessage = getString("messages.kick.flying-player", flyingKickPlayerMessage);
|
|
|
|
+ flyingKickVehicleMessage = getString("messages.kick.flying-vehicle", flyingKickVehicleMessage);
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
2022-03-30 22:28:38 +02:00
|
|
|
index 66fa0c05da7b5ca6a9a89b45bd796b50afe55a39..2259f6d9be2390aaa8ffc43b3c2e37b0036b43ac 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
2022-03-01 06:43:03 +01:00
|
|
|
@@ -300,7 +300,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
|
|
|
if (this.clientIsFloating && !this.player.isSleeping() && !this.player.isPassenger()) {
|
2021-06-11 14:02:28 +02:00
|
|
|
if (++this.aboveGroundTickCount > 80) {
|
|
|
|
ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked for floating too long!", this.player.getName().getString());
|
|
|
|
- this.disconnect(new TranslatableComponent("multiplayer.disconnect.flying"));
|
|
|
|
+ this.disconnect(com.destroystokyo.paper.PaperConfig.flyingKickPlayerMessage); // Paper - use configurable kick message
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
} else {
|
2022-03-01 06:43:03 +01:00
|
|
|
@@ -319,7 +319,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
2021-06-11 14:02:28 +02:00
|
|
|
if (this.clientVehicleIsFloating && this.player.getRootVehicle().getControllingPassenger() == this.player) {
|
|
|
|
if (++this.aboveGroundVehicleTickCount > 80) {
|
|
|
|
ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked for floating a vehicle too long!", this.player.getName().getString());
|
|
|
|
- this.disconnect(new TranslatableComponent("multiplayer.disconnect.flying"));
|
|
|
|
+ this.disconnect(com.destroystokyo.paper.PaperConfig.flyingKickVehicleMessage); // Paper - use configurable kick message
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
} else {
|