2017-08-03 16:36:06 +02:00
|
|
|
From 64a235f2f37f896fa9ef46af0791fc7bac72f131 Mon Sep 17 00:00:00 2001
|
2016-09-20 02:58:32 +02:00
|
|
|
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
|
2017-08-03 16:36:06 +02:00
|
|
|
index 2001175bf..621c585e7 100644
|
2016-09-20 02:58:32 +02:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
2017-05-05 01:08:52 +02:00
|
|
|
@@ -244,4 +244,11 @@ public class PaperConfig {
|
2016-09-20 02:58:32 +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/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
2017-08-03 16:36:06 +02:00
|
|
|
index 076f1e608..5855d2961 100644
|
2016-09-20 02:58:32 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
2017-08-03 16:36:06 +02:00
|
|
|
@@ -144,7 +144,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
2016-09-20 02:58:32 +02:00
|
|
|
if (this.B) {
|
|
|
|
if (++this.C > 80) {
|
2017-05-14 20:05:01 +02:00
|
|
|
PlayerConnection.LOGGER.warn("{} was kicked for floating too long!", this.player.getName());
|
2017-05-31 10:04:52 +02:00
|
|
|
- this.disconnect(new ChatMessage("multiplayer.disconnect.flying", new Object[0]));
|
2016-09-20 02:58:32 +02:00
|
|
|
+ this.disconnect(com.destroystokyo.paper.PaperConfig.flyingKickPlayerMessage); // Paper - use configurable kick message
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
} else {
|
2017-08-03 16:36:06 +02:00
|
|
|
@@ -163,7 +163,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
2017-06-08 16:16:51 +02:00
|
|
|
if (this.D && this.player.getVehicle().bE() == this.player) {
|
2016-09-20 02:58:32 +02:00
|
|
|
if (++this.E > 80) {
|
2017-05-14 20:05:01 +02:00
|
|
|
PlayerConnection.LOGGER.warn("{} was kicked for floating a vehicle too long!", this.player.getName());
|
2017-05-31 10:04:52 +02:00
|
|
|
- this.disconnect(new ChatMessage("multiplayer.disconnect.flying", new Object[0]));
|
2016-09-20 02:58:32 +02:00
|
|
|
+ this.disconnect(com.destroystokyo.paper.PaperConfig.flyingKickVehicleMessage); // Paper - use configurable kick message
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
--
|
2017-08-03 16:36:06 +02:00
|
|
|
2.13.3.windows.1
|
2016-09-20 02:58:32 +02:00
|
|
|
|