mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-01 04:32:11 -07:00
Fix floating warning log when the kick event is canceled (#12374)
This commit is contained in:
@@ -248,7 +248,7 @@
|
||||
if (packet.isTerminal()) {
|
||||
this.close();
|
||||
}
|
||||
@@ -165,19 +_,108 @@
|
||||
@@ -165,19 +_,115 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -315,6 +315,13 @@
|
||||
+ // Do not kick the player
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ // Log kick to console *after* event was processed.
|
||||
+ switch (cause) {
|
||||
+ case FLYING_PLAYER -> LOGGER.warn("{} was kicked for floating too long!", this.player.getName().getString());
|
||||
+ case FLYING_VEHICLE -> LOGGER.warn("{} was kicked for floating a vehicle too long!", this.player.getName().getString());
|
||||
+ }
|
||||
+
|
||||
+ // Send the possibly modified leave message
|
||||
+ this.disconnect0(new DisconnectionDetails(io.papermc.paper.adventure.PaperAdventure.asVanilla(event.reason()), disconnectionDetails.report(), disconnectionDetails.bugReportLink()), event.leaveMessage()); // Paper - Adventure & use kick event leave message
|
||||
+ }
|
||||
|
@@ -95,20 +95,24 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -285,7 +_,7 @@
|
||||
@@ -284,8 +_,8 @@
|
||||
this.knownMovePacketCount = this.receivedMovePacketCount;
|
||||
if (this.clientIsFloating && !this.player.isSleeping() && !this.player.isPassenger() && !this.player.isDeadOrDying()) {
|
||||
if (++this.aboveGroundTickCount > this.getMaximumFlyingTicks(this.player)) {
|
||||
LOGGER.warn("{} was kicked for floating too long!", this.player.getName().getString());
|
||||
- LOGGER.warn("{} was kicked for floating too long!", this.player.getName().getString());
|
||||
- this.disconnect(Component.translatable("multiplayer.disconnect.flying"));
|
||||
+ // LOGGER.warn("{} was kicked for floating too long!", this.player.getName().getString()); // Paper - Logging moved to net.minecraft.server.network.ServerCommonPacketListenerImpl.disconnect()
|
||||
+ this.disconnect(io.papermc.paper.configuration.GlobalConfiguration.get().messages.kick.flyingPlayer, org.bukkit.event.player.PlayerKickEvent.Cause.FLYING_PLAYER); // Paper - use configurable kick message & kick event cause
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
@@ -304,7 +_,7 @@
|
||||
@@ -303,8 +_,8 @@
|
||||
this.vehicleLastGoodZ = this.lastVehicle.getZ();
|
||||
if (this.clientVehicleIsFloating && this.lastVehicle.getControllingPassenger() == this.player) {
|
||||
if (++this.aboveGroundVehicleTickCount > this.getMaximumFlyingTicks(this.lastVehicle)) {
|
||||
LOGGER.warn("{} was kicked for floating a vehicle too long!", this.player.getName().getString());
|
||||
- LOGGER.warn("{} was kicked for floating a vehicle too long!", this.player.getName().getString());
|
||||
- this.disconnect(Component.translatable("multiplayer.disconnect.flying"));
|
||||
+ // LOGGER.warn("{} was kicked for floating a vehicle too long!", this.player.getName().getString()); // Paper - Logging moved to net.minecraft.server.network.ServerCommonPacketListenerImpl.disconnect()
|
||||
+ this.disconnect(io.papermc.paper.configuration.GlobalConfiguration.get().messages.kick.flyingVehicle, org.bukkit.event.player.PlayerKickEvent.Cause.FLYING_VEHICLE); // Paper - use configurable kick message & kick event cause
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user