From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Luna Date: Fri, 28 Apr 2023 16:44:50 -0300 Subject: [PATCH] Prevent player banning using duplicate UUIDs diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java index fb3f71f9824e522df22c50f55b4d41e70a1d1c63..9940f46aa5a416919f678c87c26307e5f8c309fb 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -1672,7 +1672,13 @@ public class ServerLevel extends Level implements WorldGenLevel { if (entity != null) { ServerLevel.LOGGER.warn("Force-added player with duplicate UUID {}", player.getUUID()); entity.unRide(); - this.removePlayerImmediately((ServerPlayer) entity, Entity.RemovalReason.DISCARDED); + // Scissors start - Prevent player banning using duplicate UUIDs + if (entity instanceof ServerPlayer serverPlayer) { + this.removePlayerImmediately(serverPlayer, Entity.RemovalReason.DISCARDED); + } else { + entity.discard(); + } + // Scissors end } this.entityLookup.addNewEntity(player); // Paper - rewite chunk system